Skip to content
Permalink
Browse files
Add invalid value tests to Link header handling.
https://bugs.webkit.org/show_bug.cgi?id=167366

Reviewed by Alex Christensen.

* http/tests/preload/download_resources_from_invalid_headers-expected.txt:
* http/tests/preload/resources/download_resources_from_header.php:
* http/tests/preload/resources/invalid_resources_from_header.php:


Canonical link: https://commits.webkit.org/184596@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211352 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
yoavweiss committed Jan 29, 2017
1 parent d895b6c commit e10f2aa20413ad8bb2adcbf55e5bb183da09f4ba
@@ -1,3 +1,14 @@
2017-01-29 Yoav Weiss <yoav@yoav.ws>

Add invalid value tests to Link header handling.
https://bugs.webkit.org/show_bug.cgi?id=167366

Reviewed by Alex Christensen.

* http/tests/preload/download_resources_from_invalid_headers-expected.txt:
* http/tests/preload/resources/download_resources_from_header.php:
* http/tests/preload/resources/invalid_resources_from_header.php:

2017-01-29 Gyuyoung Kim <gyuyoung.kim@webkit.org>

[EFL] Gardening on 29th Jan.
@@ -1,4 +1,5 @@
CONSOLE MESSAGE: Refused to load http://localhost:8000/preload/resources/square.png because it does not appear in the img-src directive of the Content Security Policy.
CONSOLE MESSAGE: <link rel=preload> must have a valid `as` value


--------
@@ -19,6 +20,7 @@ PASS internals.isPreloaded('http://localhost:8000/preload/resources/square.png')
PASS internals.isPreloaded('http://localhost:53/preload/resources/dummy.js'); is true
PASS internals.isPreloaded('#foobar'); is false
PASS internals.isPreloaded('../resources/Ahem.ttf'); is false
PASS internals.isPreloaded('../resources/dummy.js?invalid'); is false
PASS successfullyParsed is true

TEST COMPLETE
@@ -1,6 +1,6 @@
<?php
header("Link: <../resources/dummy.js>; rel=preload; as=script", false);
header("Link:<../resources/dummy.css>; rel=preload; as=style", false);
header("LiNk:<../resources/dummy.css>; rel=preload; as=style", false);
header("Link: <../resources/square.png>;rel=preload;as=image", false);
header("Link: <../resources/Ahem.ttf>; rel=preload; as=font; crossorigin", false);
header("Link: <../resources/test.mp4>; rel=preload; as=media", false);
@@ -18,6 +18,9 @@
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="/js-test-resources/js-test.js"></script>
@@ -39,4 +42,5 @@
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>

0 comments on commit e10f2aa

Please sign in to comment.