Bug 1435781 - Part 1: Prevent content sniffing of the response in original echo-content.py, r=nika draft
authorAnny Gakhokidze <agakhokidze@mozilla.com>
Thu, 24 May 2018 17:41:25 -0400
changeset 799881 5061f7c4584308dda26943e053b7c0f5889ed203
parent 799880 57184eb328ef1c57afedea6dd595b122daf38305
child 799900 c4a6132a63925c03216ef1320df6257ebbab297f
push id111181
push userbmo:agakhokidze@mozilla.com
push dateFri, 25 May 2018 13:55:47 +0000
reviewersnika
bugs1435781
milestone62.0a1
Bug 1435781 - Part 1: Prevent content sniffing of the response in original echo-content.py, r=nika MozReview-Commit-ID: DVHdrtERYhY
testing/web-platform/tests/fetch/api/resources/echo-content.py
--- a/testing/web-platform/tests/fetch/api/resources/echo-content.py
+++ b/testing/web-platform/tests/fetch/api/resources/echo-content.py
@@ -1,9 +1,9 @@
 def main(request, response):
 
     headers = [("X-Request-Method", request.method),
                ("X-Request-Content-Length", request.headers.get("Content-Length", "NO")),
-               ("X-Request-Content-Type", request.headers.get("Content-Type", "NO"))]
-
+               # Avoid any kind of content sniffing on the response.
+               ("Content-Type", "text/plain")]
     content = request.body
 
     return headers, content