Issue Bug Closed

#77427Wrong spelling of Content-Type header may lead to duplicate header

Michael Stucki 08/07/16, 01:54 updated 10/02/18, 11:07

Description

While debugging a BE login problem, I noticed that the response object in the ajax/rsa/publickey handler contains two Content-Type headers:

  protected 'headers' => 
    array (size=3)
      'Content-type' => 
        array (size=1)
          0 => string 'application/json; charset=utf-8' (length=31)
      'X-JSON' => 
        array (size=1)
          0 => string 'true' (length=4)
      'Content-Type' => 
        array (size=1)
          0 => string 'text/html; charset=utf-8' (length=24)

It looks like my browser is automatically ignoring the older header, so the last one takes precedence and the other one is removed. Nevertheless, I think that it could lead to problems in some circumstances.

(My original problem has been solved in the meantime. I can tell for sure that it is not related to the issue I’m describing here. However, it should still be fixed…)

My suggestion is to fix the spelling of “Content-Type” in all places to prevent eventual problems.

See also: https://www.ietf.org/rfc/rfc2616.txt

Reviews 1