servo: Merge #18617 - Removed integrity check and test for no-cors requests (from TheDan64:master); r=KiChjang
authorDaniel Kolsoi <dkolsoi@pixability.com>
Mon, 25 Sep 2017 19:15:26 -0500
changeset 670389 6be6a2554828bdcff82092ae8de1e2426b6e9632
parent 670388 bf266c3319e88fce40f00d13921c5dd6358331b6
child 670390 45cfb2a32cdeb11ae859ce02e8e3ed8522c0c494
push id81613
push userbmo:nchevobbe@mozilla.com
push dateTue, 26 Sep 2017 10:17:11 +0000
reviewersKiChjang
milestone58.0a1
servo: Merge #18617 - Removed integrity check and test for no-cors requests (from TheDan64:master); r=KiChjang Removed Step 30.2 which raised a JS TypeError if the integrity metadata was not empty. I manually ran `new Request("", {"mode" : "no-cors", "integrity" : "not an empty string"});` in servo to validate that the exception no longer arose. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #18345 - [x] These changes do not require tests because according to the ticket "Unfortunately, there's no automated test available for this yet because we are having trouble updating our copy of the upstream tests. " Source-Repo: https://github.com/servo/servo Source-Revision: e6099b43646520a4d0076bfc50dcc65b1aa8eb6b
servo/components/script/dom/request.rs
--- a/servo/components/script/dom/request.rs
+++ b/servo/components/script/dom/request.rs
@@ -319,20 +319,16 @@ impl Request {
         if r.request.borrow().mode == NetTraitsRequestMode::NoCors {
             let borrowed_request = r.request.borrow();
             // Step 30.1
             if !is_cors_safelisted_method(&borrowed_request.method) {
                 return Err(Error::Type(
                     "The mode is 'no-cors' but the method is not a cors-safelisted method".to_string()));
             }
             // Step 30.2
-            if !borrowed_request.integrity_metadata.is_empty() {
-                return Err(Error::Type("Integrity metadata is not an empty string".to_string()));
-            }
-            // Step 30.3
             r.Headers().set_guard(Guard::RequestNoCors);
         }
 
         // Step 31
         match init.headers {
             None => {
                 // This is equivalent to the specification's concept of
                 // "associated headers list". If an init headers is not given,