Title: [211616] trunk/LayoutTests
Revision
211616
Author
a...@apple.com
Date
2017-02-02 17:46:25 -0800 (Thu, 02 Feb 2017)

Log Message

Multiple HTTP tests fail with Apache 2.4.25
https://bugs.webkit.org/show_bug.cgi?id=167678
<rdar://problem/30060142>

Reviewed by Sam Weinig.

Newer versions of Apache have a security fix where they generate an internal server
error upon seeing an invalid HTTP header field. There is an opt-out configuration
option which didn't quite work in my testing, but regardless, we should only use
"nph-" CGIs for invalid responses. This is how Apache knows that it shouldn't
attempt to parse the response.

This also uncovered a test bug.

* http/tests/cache/disk-cache/resources/cache-test.js: (generateTestURL):
Without escaping, we were getting a broken response in attachment tests:
   Content-Disposition: attachment
    filename: "f.txt"
Note how ";" turned into a newline.

* http/tests/misc/non-utf8-header-name-expected.txt: Removed.
* http/tests/misc/non-utf8-header-name.php: Removed.
* http/tests/misc/nph-non-utf8-header-name-expected.txt: Copied from LayoutTests/http/tests/misc/non-utf8-header-name-expected.txt.
* http/tests/misc/nph-non-utf8-header-name.pl: Copied from LayoutTests/http/tests/misc/non-utf8-header-name.php.
* http/tests/preload/download_resources_from_invalid_headers.html:
* http/tests/preload/resources/invalid_resources_from_header.php: Removed.
* http/tests/preload/resources/nph-invalid_resources_from_header.pl: Copied from LayoutTests/http/tests/preload/resources/invalid_resources_from_header.php.
* http/tests/security/contentSecurityPolicy/directive-parsing-01.html:
* http/tests/security/contentSecurityPolicy/directive-parsing-02.html:
* http/tests/security/contentSecurityPolicy/directive-parsing-03.html:
* http/tests/security/contentSecurityPolicy/directive-parsing-04.html:
* http/tests/security/contentSecurityPolicy/directive-parsing-05.html:
* http/tests/security/contentSecurityPolicy/resources/echo-script-src.pl: Removed.
* http/tests/security/contentSecurityPolicy/resources/multiple-iframe-test.js:
* http/tests/security/contentSecurityPolicy/resources/nph-echo-script-src.pl: Copied from LayoutTests/http/tests/security/contentSecurityPolicy/resources/echo-script-src.pl.
* http/tests/security/contentSecurityPolicy/script-loads-with-img-src.html:
* http/tests/security/contentSecurityPolicy/script-src-none.html:
* http/tests/security/contentSecurityPolicy/script-src-self-blocked-01.html:
* http/tests/security/contentSecurityPolicy/script-src-self-blocked-02.html:
* http/tests/security/contentSecurityPolicy/script-src-self-blocked-03.html:
* http/tests/security/contentSecurityPolicy/script-src-self.html:
* http/tests/security/contentSecurityPolicy/script-src-star-cross-scheme.html:
Changed scripts that are used to generate invalid responses to "nph-" ones.

Modified Paths

Added Paths

Removed Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (211615 => 211616)


--- trunk/LayoutTests/ChangeLog	2017-02-03 01:36:53 UTC (rev 211615)
+++ trunk/LayoutTests/ChangeLog	2017-02-03 01:46:25 UTC (rev 211616)
@@ -1,3 +1,49 @@
+2017-02-02  Alexey Proskuryakov  <a...@apple.com>
+
+        Multiple HTTP tests fail with Apache 2.4.25
+        https://bugs.webkit.org/show_bug.cgi?id=167678
+        <rdar://problem/30060142>
+
+        Reviewed by Sam Weinig.
+
+        Newer versions of Apache have a security fix where they generate an internal server
+        error upon seeing an invalid HTTP header field. There is an opt-out configuration
+        option which didn't quite work in my testing, but regardless, we should only use
+        "nph-" CGIs for invalid responses. This is how Apache knows that it shouldn't
+        attempt to parse the response.
+
+        This also uncovered a test bug.
+
+        * http/tests/cache/disk-cache/resources/cache-test.js: (generateTestURL):
+        Without escaping, we were getting a broken response in attachment tests:
+           Content-Disposition: attachment
+            filename: "f.txt"
+        Note how ";" turned into a newline.
+
+        * http/tests/misc/non-utf8-header-name-expected.txt: Removed.
+        * http/tests/misc/non-utf8-header-name.php: Removed.
+        * http/tests/misc/nph-non-utf8-header-name-expected.txt: Copied from LayoutTests/http/tests/misc/non-utf8-header-name-expected.txt.
+        * http/tests/misc/nph-non-utf8-header-name.pl: Copied from LayoutTests/http/tests/misc/non-utf8-header-name.php.
+        * http/tests/preload/download_resources_from_invalid_headers.html:
+        * http/tests/preload/resources/invalid_resources_from_header.php: Removed.
+        * http/tests/preload/resources/nph-invalid_resources_from_header.pl: Copied from LayoutTests/http/tests/preload/resources/invalid_resources_from_header.php.
+        * http/tests/security/contentSecurityPolicy/directive-parsing-01.html:
+        * http/tests/security/contentSecurityPolicy/directive-parsing-02.html:
+        * http/tests/security/contentSecurityPolicy/directive-parsing-03.html:
+        * http/tests/security/contentSecurityPolicy/directive-parsing-04.html:
+        * http/tests/security/contentSecurityPolicy/directive-parsing-05.html:
+        * http/tests/security/contentSecurityPolicy/resources/echo-script-src.pl: Removed.
+        * http/tests/security/contentSecurityPolicy/resources/multiple-iframe-test.js:
+        * http/tests/security/contentSecurityPolicy/resources/nph-echo-script-src.pl: Copied from LayoutTests/http/tests/security/contentSecurityPolicy/resources/echo-script-src.pl.
+        * http/tests/security/contentSecurityPolicy/script-loads-with-img-src.html:
+        * http/tests/security/contentSecurityPolicy/script-src-none.html:
+        * http/tests/security/contentSecurityPolicy/script-src-self-blocked-01.html:
+        * http/tests/security/contentSecurityPolicy/script-src-self-blocked-02.html:
+        * http/tests/security/contentSecurityPolicy/script-src-self-blocked-03.html:
+        * http/tests/security/contentSecurityPolicy/script-src-self.html:
+        * http/tests/security/contentSecurityPolicy/script-src-star-cross-scheme.html:
+        Changed scripts that are used to generate invalid responses to "nph-" ones.
+
 2017-02-02  Chris Dumez  <cdu...@apple.com>
 
         Suspend SVG animations in hidden pages

Modified: trunk/LayoutTests/http/tests/cache/disk-cache/resources/cache-test.js (211615 => 211616)


--- trunk/LayoutTests/http/tests/cache/disk-cache/resources/cache-test.js	2017-02-03 01:36:53 UTC (rev 211615)
+++ trunk/LayoutTests/http/tests/cache/disk-cache/resources/cache-test.js	2017-02-03 01:46:25 UTC (rev 211616)
@@ -42,7 +42,7 @@
 
 function generateTestURL(test)
 {
-    var body = typeof test.body !== 'undefined' ? test.body : "";
+    var body = typeof test.body !== 'undefined' ? escape(test.body) : "";
     var expiresInFutureIn304 = typeof test.expiresInFutureIn304 !== 'undefined' ? test.expiresInFutureIn304 : false;
     var uniqueTestId = Math.floor((Math.random() * 1000000000000));
     var testURL = "resources/generate-response.cgi?body=" + body;
@@ -54,7 +54,7 @@
     if (!test.responseHeaders || !test.responseHeaders["Content-Type"])
         testURL += "&Content-Type=text/plain";
     for (var header in test.responseHeaders)
-        testURL += '&' + header + '=' + makeHeaderValue(test.responseHeaders[header]);
+        testURL += '&' + header + '=' + escape(makeHeaderValue(test.responseHeaders[header]));
     return testURL;
 }
 

Deleted: trunk/LayoutTests/http/tests/misc/non-utf8-header-name-expected.txt (211615 => 211616)


--- trunk/LayoutTests/http/tests/misc/non-utf8-header-name-expected.txt	2017-02-03 01:36:53 UTC (rev 211615)
+++ trunk/LayoutTests/http/tests/misc/non-utf8-header-name-expected.txt	2017-02-03 01:46:25 UTC (rev 211616)
@@ -1 +0,0 @@
-Test for bug 96284: Non UTF-8 HTTP headers do not cause a crash.

Deleted: trunk/LayoutTests/http/tests/misc/non-utf8-header-name.php (211615 => 211616)


--- trunk/LayoutTests/http/tests/misc/non-utf8-header-name.php	2017-02-03 01:36:53 UTC (rev 211615)
+++ trunk/LayoutTests/http/tests/misc/non-utf8-header-name.php	2017-02-03 01:46:25 UTC (rev 211616)
@@ -1,9 +0,0 @@
-<?php
-header('HTTP/1.1 200 OK');
-header('\xC3: text/html');
-echo '<script>';
-echo '   if (window.testRunner)';
-echo '       testRunner.dumpAsText();';
-echo '</script>';
-echo '<p>Test for <a href="" 96284</a>: Non UTF-8 HTTP headers do not cause a crash.</p>';
-?>

Copied: trunk/LayoutTests/http/tests/misc/nph-non-utf8-header-name-expected.txt (from rev 211613, trunk/LayoutTests/http/tests/misc/non-utf8-header-name-expected.txt) (0 => 211616)


--- trunk/LayoutTests/http/tests/misc/nph-non-utf8-header-name-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/http/tests/misc/nph-non-utf8-header-name-expected.txt	2017-02-03 01:46:25 UTC (rev 211616)
@@ -0,0 +1 @@
+Test for bug 96284: Non UTF-8 HTTP headers do not cause a crash.

Added: trunk/LayoutTests/http/tests/misc/nph-non-utf8-header-name.pl (0 => 211616)


--- trunk/LayoutTests/http/tests/misc/nph-non-utf8-header-name.pl	                        (rev 0)
+++ trunk/LayoutTests/http/tests/misc/nph-non-utf8-header-name.pl	2017-02-03 01:46:25 UTC (rev 211616)
@@ -0,0 +1,14 @@
+#!/usr/bin/perl -wT
+use strict;
+
+print <<"EOL";
+HTTP/1.1 200 OK
+\xC3: text/html
+Content-Type: text/html
+
+<script>
+   if (window.testRunner)
+       testRunner.dumpAsText();
+</script>
+<p>Test for <a href="" 96284</a>: Non UTF-8 HTTP headers do not cause a crash.</p>
+EOL
Property changes on: trunk/LayoutTests/http/tests/misc/nph-non-utf8-header-name.pl
___________________________________________________________________

Added: svn:executable

+* \ No newline at end of property

Modified: trunk/LayoutTests/http/tests/preload/download_resources_from_invalid_headers.html (211615 => 211616)


--- trunk/LayoutTests/http/tests/preload/download_resources_from_invalid_headers.html	2017-02-03 01:36:53 UTC (rev 211615)
+++ trunk/LayoutTests/http/tests/preload/download_resources_from_invalid_headers.html	2017-02-03 01:46:25 UTC (rev 211616)
@@ -5,5 +5,5 @@
         testRunner.dumpChildFramesAsText();
     }
 </script>
-<iframe src=""
+<iframe src=""
 

Deleted: trunk/LayoutTests/http/tests/preload/resources/invalid_resources_from_header.php (211615 => 211616)


--- trunk/LayoutTests/http/tests/preload/resources/invalid_resources_from_header.php	2017-02-03 01:36:53 UTC (rev 211615)
+++ trunk/LayoutTests/http/tests/preload/resources/invalid_resources_from_header.php	2017-02-03 01:46:25 UTC (rev 211616)
@@ -1,46 +0,0 @@
-<?php
-header("Link: <   ../resources/dummy.js >; rel=preload; as=script", false);
-header("Link: <../משאבים/dummy.css>; rel=preload; as=style", false);
-header("Link: <../résôûrcès/dummy.css>; rel=preload; as=style", false);
-header("Link: <../resources/Ahem{.ttf,.woff}>; rel=preload; as=font; crossorigin", false);
-header("Link: <../resources/test\f.mp4>; rel=preload; as=media", false);
-header("Link: <../security/resources/cap\ttions.vtt>; rel=preload; as=track", false);
-header("Link: <../resources/dummy   .xml>; rel=preload;", false);
-header("Link: <../resources/dumm>y.xml>; rel=preload", false);
-header("Content-Security-Policy: img-src 'none'", false);
-header("Link: <http://localhost:8000/preload/resources/square.png>; rel=preload; as=image", false);
-header("Link: <http://localhost:53/preload/resources/dummy.js>; rel=preload; as=script", false);
-header("Link: <#foobar>; rel=preload; as=style", false);
-header("Link: <>; rel=preload; as=style", false);
-header("Link: <   \t>; rel=preload; as=style", false);
-header("Link: >; rel=preload; as=style", false);
-header("Link: <; rel=preload; as=style", false);
-header("Link: ; rel=preload; as=style", false);
-header("Link <../resources/Ahem.ttf>; rel=preload; as=font; crossorigin", false);
-header("Link: <   ../resources/dummy.js?foobar >; rel=preload; as='", false);
-header("Link: <<../resources/dummy.js?invalid>>; rel=preload; as=script", false);
-header("Link: <../resources/dummy.js?invalid>>; rel=preload; as=script", false);
-header("Link: <<../resources/dummy.js?invalid>; rel=preload; as=script", false);
-?>
-<!DOCTYPE html>
-<script src=""
-<script>
-    shouldBeTrue("internals.isPreloaded('../resources/dummy.js');");
-    shouldBeFalse("internals.isPreloaded('../משאבים/dummy.css');");
-    shouldBeFalse("internals.isPreloaded('../résôûrcès/square.png');");
-    // Invalid URLs get preloaded (and get terminated further down the stack)
-    shouldBeTrue("internals.isPreloaded('../resources/Ahem{.ttf,.woff}');");
-    shouldBeFalse("internals.isPreloaded('../resources/test.mp4');");
-    shouldBeTrue("internals.isPreloaded('../resources/test\f.mp4');");
-    shouldBeTrue("internals.isPreloaded('../security/resources/cap\ttions.vtt');");
-    shouldBeFalse("internals.isPreloaded('../resources/dummy.xml?badvalue');");
-    shouldBeTrue("internals.isPreloaded('../resources/dummy   .xml');");
-    shouldBeFalse("internals.isPreloaded('../resources/dummy.xml');");
-    shouldBeFalse("internals.isPreloaded('../resources/dumm');");
-    shouldBeFalse("internals.isPreloaded('http://localhost:8000/preload/resources/square.png');");
-    // Invalid ports get preloaded (and get terminated further down the stack).
-    shouldBeTrue("internals.isPreloaded('http://localhost:53/preload/resources/dummy.js');");
-    shouldBeFalse("internals.isPreloaded('#foobar');");
-    shouldBeFalse("internals.isPreloaded('../resources/Ahem.ttf');");
-    shouldBeFalse("internals.isPreloaded('../resources/dummy.js?invalid');");
-</script>

Added: trunk/LayoutTests/http/tests/preload/resources/nph-invalid_resources_from_header.pl (0 => 211616)


--- trunk/LayoutTests/http/tests/preload/resources/nph-invalid_resources_from_header.pl	                        (rev 0)
+++ trunk/LayoutTests/http/tests/preload/resources/nph-invalid_resources_from_header.pl	2017-02-03 01:46:25 UTC (rev 211616)
@@ -0,0 +1,52 @@
+#!/usr/bin/perl -wT
+use strict;
+
+print <<"EOL";
+HTTP/1.1 200 OK
+Link: <   ../resources/dummy.js >; rel=preload; as=script
+Link: <../משאבים/dummy.css>; rel=preload; as=style
+Link: <../résôûrcès/dummy.css>; rel=preload; as=style
+Link: <../resources/Ahem{.ttf,.woff}>; rel=preload; as=font; crossorigin
+Link: <../resources/test\f.mp4>; rel=preload; as=media
+Link: <../security/resources/cap\ttions.vtt>; rel=preload; as=track
+Link: <../resources/dummy   .xml>; rel=preload;
+Link: <../resources/dumm>y.xml>; rel=preload
+Content-Security-Policy: img-src 'none'
+Link: <http://localhost:8000/preload/resources/square.png>; rel=preload; as=image
+Link: <http://localhost:53/preload/resources/dummy.js>; rel=preload; as=script
+Link: <#foobar>; rel=preload; as=style
+Link: <>; rel=preload; as=style
+Link: <   \t>; rel=preload; as=style
+Link: >; rel=preload; as=style
+Link: <; rel=preload; as=style
+Link: ; rel=preload; as=style
+Link <../resources/Ahem.ttf>; rel=preload; as=font; crossorigin
+Link: <   ../resources/dummy.js?foobar >; rel=preload; as='
+Link: <<../resources/dummy.js?invalid>>; rel=preload; as=script
+Link: <../resources/dummy.js?invalid>>; rel=preload; as=script
+Link: <<../resources/dummy.js?invalid>; rel=preload; as=script
+Content-Type: text/html
+
+<!DOCTYPE html>
+<script src=""
+<script>
+    shouldBeTrue("internals.isPreloaded('../resources/dummy.js');");
+    shouldBeFalse("internals.isPreloaded('../משאבים/dummy.css');");
+    shouldBeFalse("internals.isPreloaded('../résôûrcès/square.png');");
+    // Invalid URLs get preloaded (and get terminated further down the stack)
+    shouldBeTrue("internals.isPreloaded('../resources/Ahem{.ttf,.woff}');");
+    shouldBeFalse("internals.isPreloaded('../resources/test.mp4');");
+    shouldBeTrue("internals.isPreloaded('../resources/test\f.mp4');");
+    shouldBeTrue("internals.isPreloaded('../security/resources/cap\ttions.vtt');");
+    shouldBeFalse("internals.isPreloaded('../resources/dummy.xml?badvalue');");
+    shouldBeTrue("internals.isPreloaded('../resources/dummy   .xml');");
+    shouldBeFalse("internals.isPreloaded('../resources/dummy.xml');");
+    shouldBeFalse("internals.isPreloaded('../resources/dumm');");
+    shouldBeFalse("internals.isPreloaded('http://localhost:8000/preload/resources/square.png');");
+    // Invalid ports get preloaded (and get terminated further down the stack).
+    shouldBeTrue("internals.isPreloaded('http://localhost:53/preload/resources/dummy.js');");
+    shouldBeFalse("internals.isPreloaded('#foobar');");
+    shouldBeFalse("internals.isPreloaded('../resources/Ahem.ttf');");
+    shouldBeFalse("internals.isPreloaded('../resources/dummy.js?invalid');");
+</script>
+EOL
\ No newline at end of file
Property changes on: trunk/LayoutTests/http/tests/preload/resources/nph-invalid_resources_from_header.pl
___________________________________________________________________

Added: svn:executable

+* \ No newline at end of property

Modified: trunk/LayoutTests/http/tests/security/contentSecurityPolicy/directive-parsing-01.html (211615 => 211616)


--- trunk/LayoutTests/http/tests/security/contentSecurityPolicy/directive-parsing-01.html	2017-02-03 01:36:53 UTC (rev 211615)
+++ trunk/LayoutTests/http/tests/security/contentSecurityPolicy/directive-parsing-01.html	2017-02-03 01:46:25 UTC (rev 211616)
@@ -12,6 +12,6 @@
   <p>
     This script should not execute even though there are parse errors in the policy.
   </p>
-  <iframe src=""
+  <iframe src=""
 </body>
 </html>

Modified: trunk/LayoutTests/http/tests/security/contentSecurityPolicy/directive-parsing-02.html (211615 => 211616)


--- trunk/LayoutTests/http/tests/security/contentSecurityPolicy/directive-parsing-02.html	2017-02-03 01:36:53 UTC (rev 211615)
+++ trunk/LayoutTests/http/tests/security/contentSecurityPolicy/directive-parsing-02.html	2017-02-03 01:46:25 UTC (rev 211616)
@@ -12,6 +12,6 @@
   <p>
     This script should not execute even though there are parse errors in the policy.
   </p>
-  <iframe src=""
+  <iframe src=""
 </body>
 </html>

Modified: trunk/LayoutTests/http/tests/security/contentSecurityPolicy/directive-parsing-03.html (211615 => 211616)


--- trunk/LayoutTests/http/tests/security/contentSecurityPolicy/directive-parsing-03.html	2017-02-03 01:36:53 UTC (rev 211615)
+++ trunk/LayoutTests/http/tests/security/contentSecurityPolicy/directive-parsing-03.html	2017-02-03 01:46:25 UTC (rev 211616)
@@ -12,6 +12,6 @@
   <p>
     This script should not execute even though there are parse errors in the policy.
   </p>
-  <iframe src=""
+  <iframe src=""
 </body>
 </html>

Modified: trunk/LayoutTests/http/tests/security/contentSecurityPolicy/directive-parsing-04.html (211615 => 211616)


--- trunk/LayoutTests/http/tests/security/contentSecurityPolicy/directive-parsing-04.html	2017-02-03 01:36:53 UTC (rev 211615)
+++ trunk/LayoutTests/http/tests/security/contentSecurityPolicy/directive-parsing-04.html	2017-02-03 01:46:25 UTC (rev 211616)
@@ -13,6 +13,6 @@
     A warning should be logged to the console, as `script-src: 'none'` shouldn't
     contain a colon. Since the directive is invalid, the script should run.
   </p>
-  <iframe src=""
+  <iframe src=""
 </body>
 </html>

Modified: trunk/LayoutTests/http/tests/security/contentSecurityPolicy/directive-parsing-05.html (211615 => 211616)


--- trunk/LayoutTests/http/tests/security/contentSecurityPolicy/directive-parsing-05.html	2017-02-03 01:36:53 UTC (rev 211615)
+++ trunk/LayoutTests/http/tests/security/contentSecurityPolicy/directive-parsing-05.html	2017-02-03 01:46:25 UTC (rev 211616)
@@ -12,7 +12,7 @@
   <p>
     Directives starting with an invalid character should be logged and ignored.
   </p>
-  <iframe src=""
+  <iframe src=""
 </body>
 </html>
 

Deleted: trunk/LayoutTests/http/tests/security/contentSecurityPolicy/resources/echo-script-src.pl (211615 => 211616)


--- trunk/LayoutTests/http/tests/security/contentSecurityPolicy/resources/echo-script-src.pl	2017-02-03 01:36:53 UTC (rev 211615)
+++ trunk/LayoutTests/http/tests/security/contentSecurityPolicy/resources/echo-script-src.pl	2017-02-03 01:46:25 UTC (rev 211616)
@@ -1,32 +0,0 @@
-#!/usr/bin/perl -wT
-use strict;
-use CGI;
-
-my $cgi = new CGI;
-
-print "Content-Type: text/html; charset=UTF-8\n";
-my $experimental = $cgi->param('experimental') || "";
-if ($experimental eq 'true') {
-    print "X-WebKit-CSP: " . $cgi->param('csp') . "\n\n";
-} else {
-    print "Content-Security-Policy: " . $cgi->param('csp') . "\n\n";
-}
-
-my ($text, $replacement) = ("FAIL", "PASS");
-($text, $replacement) = ($replacement, $text) if $cgi->param('should_run') eq 'no';
-
-my $nonce = $cgi->param('nonce') || "";
-if ($nonce ne "") {
-    $nonce = "nonce='" . $nonce . "'";
-}
-
-
-print "<!DOCTYPE html>\n";
-print "<html>\n";
-print "<body>\n";
-print "<div id=\"result\" text=\"$replacement\">\n";
-print "$text\n";
-print "</div>\n";
-print "<script $nonce src="" . $cgi->param('q') . "\"></script>\n";
-print "</body>\n";
-print "</html>\n";

Modified: trunk/LayoutTests/http/tests/security/contentSecurityPolicy/resources/multiple-iframe-test.js (211615 => 211616)


--- trunk/LayoutTests/http/tests/security/contentSecurityPolicy/resources/multiple-iframe-test.js	2017-02-03 01:36:53 UTC (rev 211615)
+++ trunk/LayoutTests/http/tests/security/contentSecurityPolicy/resources/multiple-iframe-test.js	2017-02-03 01:46:25 UTC (rev 211616)
@@ -32,7 +32,7 @@
     if (current[2].match(/^data:/) || current[2].match(/^https?:/))
         scriptToLoad = encodeURIComponent(current[2]);
 
-    iframe.src = "" + "resources/echo-script-src.pl?" +
+    iframe.src = "" + "resources/nph-echo-script-src.pl?" +
                  "experimental=" + (experimental ? "true" : "false") +
                  "&should_run=" + encodeURIComponent(current[0]) +
                  "&csp=" + policy + "&q=" + scriptToLoad;

Copied: trunk/LayoutTests/http/tests/security/contentSecurityPolicy/resources/nph-echo-script-src.pl (from rev 211613, trunk/LayoutTests/http/tests/security/contentSecurityPolicy/resources/echo-script-src.pl) (0 => 211616)


--- trunk/LayoutTests/http/tests/security/contentSecurityPolicy/resources/nph-echo-script-src.pl	                        (rev 0)
+++ trunk/LayoutTests/http/tests/security/contentSecurityPolicy/resources/nph-echo-script-src.pl	2017-02-03 01:46:25 UTC (rev 211616)
@@ -0,0 +1,33 @@
+#!/usr/bin/perl -wT
+use strict;
+use CGI;
+
+my $cgi = new CGI;
+
+print "HTTP/1.1 200 OK\n";
+print "Content-Type: text/html; charset=UTF-8\n";
+my $experimental = $cgi->param('experimental') || "";
+if ($experimental eq 'true') {
+    print "X-WebKit-CSP: " . $cgi->param('csp') . "\n\n";
+} else {
+    print "Content-Security-Policy: " . $cgi->param('csp') . "\n\n";
+}
+
+my ($text, $replacement) = ("FAIL", "PASS");
+($text, $replacement) = ($replacement, $text) if $cgi->param('should_run') eq 'no';
+
+my $nonce = $cgi->param('nonce') || "";
+if ($nonce ne "") {
+    $nonce = "nonce='" . $nonce . "'";
+}
+
+
+print "<!DOCTYPE html>\n";
+print "<html>\n";
+print "<body>\n";
+print "<div id=\"result\" text=\"$replacement\">\n";
+print "$text\n";
+print "</div>\n";
+print "<script $nonce src="" . $cgi->param('q') . "\"></script>\n";
+print "</body>\n";
+print "</html>\n";

Modified: trunk/LayoutTests/http/tests/security/contentSecurityPolicy/script-loads-with-img-src.html (211615 => 211616)


--- trunk/LayoutTests/http/tests/security/contentSecurityPolicy/script-loads-with-img-src.html	2017-02-03 01:36:53 UTC (rev 211615)
+++ trunk/LayoutTests/http/tests/security/contentSecurityPolicy/script-loads-with-img-src.html	2017-02-03 01:46:25 UTC (rev 211616)
@@ -9,6 +9,6 @@
 </script>
 </head>
 <body>
-  <iframe src=""
+  <iframe src=""
 </body>
 </html>

Modified: trunk/LayoutTests/http/tests/security/contentSecurityPolicy/script-src-none.html (211615 => 211616)


--- trunk/LayoutTests/http/tests/security/contentSecurityPolicy/script-src-none.html	2017-02-03 01:36:53 UTC (rev 211615)
+++ trunk/LayoutTests/http/tests/security/contentSecurityPolicy/script-src-none.html	2017-02-03 01:46:25 UTC (rev 211616)
@@ -12,6 +12,6 @@
   <p>
     Loads an iframe which in turns tries to load an external script. The iframe has a content security policy disabling external scripts. So the script should not get executed.
   </p>
-  <iframe src=""
+  <iframe src=""
 </body>
 </html>

Modified: trunk/LayoutTests/http/tests/security/contentSecurityPolicy/script-src-self-blocked-01.html (211615 => 211616)


--- trunk/LayoutTests/http/tests/security/contentSecurityPolicy/script-src-self-blocked-01.html	2017-02-03 01:36:53 UTC (rev 211615)
+++ trunk/LayoutTests/http/tests/security/contentSecurityPolicy/script-src-self-blocked-01.html	2017-02-03 01:46:25 UTC (rev 211616)
@@ -9,6 +9,6 @@
 </script>
 </head>
 <body>
-  <iframe src=""
+  <iframe src=""
 </body>
 </html>

Modified: trunk/LayoutTests/http/tests/security/contentSecurityPolicy/script-src-self-blocked-02.html (211615 => 211616)


--- trunk/LayoutTests/http/tests/security/contentSecurityPolicy/script-src-self-blocked-02.html	2017-02-03 01:36:53 UTC (rev 211615)
+++ trunk/LayoutTests/http/tests/security/contentSecurityPolicy/script-src-self-blocked-02.html	2017-02-03 01:46:25 UTC (rev 211616)
@@ -9,6 +9,6 @@
 </script>
 </head>
 <body>
-  <iframe src=""
+  <iframe src=""
 </body>
 </html>

Modified: trunk/LayoutTests/http/tests/security/contentSecurityPolicy/script-src-self-blocked-03.html (211615 => 211616)


--- trunk/LayoutTests/http/tests/security/contentSecurityPolicy/script-src-self-blocked-03.html	2017-02-03 01:36:53 UTC (rev 211615)
+++ trunk/LayoutTests/http/tests/security/contentSecurityPolicy/script-src-self-blocked-03.html	2017-02-03 01:46:25 UTC (rev 211616)
@@ -9,6 +9,6 @@
 </script>
 </head>
 <body>
-  <iframe src=""
+  <iframe src=""
 </body>
 </html>

Modified: trunk/LayoutTests/http/tests/security/contentSecurityPolicy/script-src-self.html (211615 => 211616)


--- trunk/LayoutTests/http/tests/security/contentSecurityPolicy/script-src-self.html	2017-02-03 01:36:53 UTC (rev 211615)
+++ trunk/LayoutTests/http/tests/security/contentSecurityPolicy/script-src-self.html	2017-02-03 01:46:25 UTC (rev 211616)
@@ -9,6 +9,6 @@
 </script>
 </head>
 <body>
-  <iframe src=""
+  <iframe src=""
 </body>
 </html>

Modified: trunk/LayoutTests/http/tests/security/contentSecurityPolicy/script-src-star-cross-scheme.html (211615 => 211616)


--- trunk/LayoutTests/http/tests/security/contentSecurityPolicy/script-src-star-cross-scheme.html	2017-02-03 01:36:53 UTC (rev 211615)
+++ trunk/LayoutTests/http/tests/security/contentSecurityPolicy/script-src-star-cross-scheme.html	2017-02-03 01:46:25 UTC (rev 211616)
@@ -9,6 +9,6 @@
 </script>
 </head>
 <body>
-  <iframe src=""
+  <iframe src=""
 </body>
 </html>
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to