Handle some html/js polyglots in CORB confirmation sniffing.
Cross-Origin Read Blocking (CORB) tries to protect certain resource types (e.g. text/html). To be resilient against HTTP responses mislabeled with an incorrect Content-Type, CORB sniffs the response body to confirm if it truly is the protected type. Before this CL the confirmation sniffing logic decided to block resources that are both a valid html and a valid javascript. Blocking of such resources is undesirable, because it is disruptive to existing websites that use such polyglot responses in <script> tags. After this CL, a HTML comment that contains a Javascript comment will cause the confirmation sniffing to decide that the response is not really a HTML document (this will prevent CORB blocking). Bug: 839425 Cq-Include-Trybots: master.tryserver.chromium.linux:linux_mojo Change-Id: Ie790a81c2742513aed9fda45edd0bb2976bd0fc6 Reviewed-on: https://chromium-review.googlesource.com/1042820 Commit-Queue: Łukasz Anforowicz <lukasza@chromium.org> Reviewed-by:Charlie Reis <creis@chromium.org> Cr-Commit-Position: refs/heads/master@{#555951}
Showing
Please register or sign in to comment