Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upDon't interpret binary files as HTML #7706
Comments
|
Rather than a black list with |
|
is it possible a n00b like me can fix it |
|
@s142857 I think you should give it a shot :) |
|
could you guide me @jdm |
|
First step is to find the |
|
Fixed by #7956. |
We want to avoid interpreting streams of binary bytes as HTML, since that's silly and easily breaks our layout code that is unprepared for such things. In the code that receives the HTTP headers for a page (ParserContext::headers_available) we should check for the
Content-Typeheaderapplication/octet-streamand ignore the forthcoming response body if the header matches. We can replace it with an informative message in the same way that we create a special document for images in that method.Testcase: firefox.com and press the download button
Code: components/script/dom/servohtmlparser.rs