CSS File not rendered if multiple Content-Type headers
Reported by
robininf...@gmail.com,
Oct 12 2017
|
|||||||
Issue descriptionUserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36 Steps to reproduce the problem: 1. Make a html page with a CSS file used 2. Set a server serve this files and have two content type header or the CSS file * Content-Type: plain/text * Content-Type: text/css 3. Go to your browser to visit this webpage What is the expected behavior? Have the webpage displaying with the css style or prompt a warning about a css file transferred with plain/text What went wrong? The css is loaded but not used and doesn't prompt any warning Did this work before? N/A Chrome version: 61.0.3163.100 Channel: stable OS Version: Ubuntu 16.04.3 LTS Flash Version:
,
Oct 14 2017
It can be any HTML that load a css file and the server serve the CSS file with Content-Type headers : Content-Type: text/plain Content-Type: text/css Like this ones attached
,
Oct 14 2017
Thank you for providing more feedback. Adding requester "susanjuniab@chromium.org" to the cc list and removing "Needs-Feedback" label. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Oct 14 2017
Here is a nodejs script to serve the css file with problematic header.
,
Oct 16 2017
Unable to reproduce the issue on Win-10 and Ubuntu 16.04 using chrome reported version #61.0.3163.100 and latest dev#63.0.3236.7. Attached a screen shotfor reference. Following are the steps followed to reproduce the issue. ------------ 1. Opened the attached file "test.html" in chrome browser. Note: Kept all the 3 files i.e test.css, test.html and index.js in a folder. 2. Observed that the page appeared red as per the css file. Reporter@ - Could you please check the attached screen shot and please let us know if anything missed from our side. Also please check the issue on latest dev #63.0.3236.7 by creating a new profile without any apps and extensions and please let us know if the issue still persist or not. Thanks...!!
,
Oct 16 2017
Open it as a file like in the screenshot will not cause the problem The problem is caused by the duplicated Content-Type field from the server. Try it with all included files and run the javascript file with node (I tried it with Node v8.7.0) and you will see that the content is correctly loaded however the background will not be red as expected and the console will not print warning about the content type.
,
Oct 16 2017
Thank you for providing more feedback. Adding requester "krajshree@chromium.org" to the cc list and removing "Needs-Feedback" label. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Oct 16 2017
Screenshot of the page with the nodejs server.
,
Oct 16 2017
Result of this page in Firefox and Edge for comparison
,
Oct 17 2017
Unable to reproduce the issue on Ubuntu 16.04 using chrome reported version #61.0.3163.100 and latest dev#63.0.3236.7. Attached a screen cast for reference. Following are the steps followed to reproduce the issue. ------------ 1. Opened the attached file "test.html" by running a localhost:8000//test.html in chrome browser. 2. Observed that the page appeared red as per the css file. Requesting any dev from Blink>CSS team to please have a look into the issue. Thanks...!!
,
Oct 17 2017
This is because you serve the file with Python which don't make a duplicate of the Content-Type header. Please use my given nodejs script or configure a server to serve content-type two times like on this screenshot https://storage.googleapis.com/monorail-prod.appspot.com/16/attachments/75089654-f652-46c3-9f41-f43de22545d1?Expires=1508239191&GoogleAccessId=monorail-prod%40appspot.gserviceaccount.com&Signature=PVDQLeyK6o2%2F7dQx1ODAxwsv4OFlE3gFaXgrQFIJvdEXzsJAO2ep2GkuCyMGIPp183zdoETYGfFjg4o8iMa8bDKKQNm4YoaJQlYTCoRunsJVJ3jPy34y5Je6FJRTOOAknlNlH656y5YpDHDJQrzfNauARJ0MZUO8E7tE832oJiunC%2FRE0ugfXUMRo7qa%2FLz9RYF1ih2L%2BD0NaQW8UauJ6jQni1i5DpeT1TgW2NOvHXi4H%2BiV1x9SEfvGbsMvUP7rTo2r4QfIILI2H99VuJTfdPE3ntrSs%2Bae%2FC467NYvlpeSugV3n1cGUv2hZHDIeNK6Es8BLaE0UEN6ubYEG4RpUQ%3D%3D
,
Oct 17 2017
If you use my script and have node installed: 1. Use 'node index.js' to start the server on port 8080 2. Go to http://127.0.0.1:8080 3. You will see that the webpage have a white background (instead of red) even if the css is loaded without a warning.
,
Oct 17 2017
Appears to be an issue with HTTP headers, so redirecting to Internals>Network, but I could be wrong.
,
Oct 20 2017
Sending two Content-Type headers is invalid. https://tools.ietf.org/html/rfc7230#section-3.2.2 " A sender MUST NOT generate multiple header fields with the same field name in a message unless either the entire field value for that header field is defined as a comma-separated list [i.e., #(values)] or the header field is a well-known exception (as noted below)." Content-type is not such a header.
,
Oct 20 2017
Well at least warn about invalid header, like so developers will be able to know that's something about server headers is wrong instead of searching for an issue which looks like a render issue, has the css is correctly loaded, but not use and that without a warning. I think we need to have at least a warning for such a case as Chromium doesn't know how to hold that case. |
|||||||
►
Sign in to add a comment |
|||||||
Comment 1 by susanjuniab@chromium.org
, Oct 13 2017Labels: Needs-Triage-M61 Needs-Feedback