Results 1 to 2 of 2

Thread: Problem with setHeaderEx() in webserver context

Hybrid View

  1. #1
    Join Date
    May 2016
    Posts
    18

    Default Problem with setHeaderEx() in webserver context

    I'm doing the following:

    setHeaderEx("Content-Type", "application/json", true)

    According to the documentation, this should replace the contents of the Content-Type header. Although it does appear to replace the contents of that header, it adds a second Content-Type header. If I change the boolean to false, it still adds a second Content-Type header with application/json, but does not change the value of the original Content-Type header.

    eg:

    setHeaderEx("Content-Type", "application/json", true)

    Content-Type: application/json
    Content-Type: application/json

    setHeaderEx("Content-Type", "application/json", false)

    Content-Type: text/html
    Content-Type: application/json

    This confuses some clients and, rather obviously, it does not follow the HTML specification. I also noticed that if I do not match the case exactly, it behaves even worse:

    setHeaderEx("content-type", "application/json", true)

    Content-Type: text/html
    content-type: application/json

    setHeaderEx("content-type", "application/json", false)

    Content-Type: text/html
    content-type: application/json

    I'm using Girder 6.0.19.1 for Windows.

  2. #2
    Join Date
    May 2016
    Posts
    18

    Default

    bump, never answered

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •