Skip to content

Commit bcadca5

Browse files
committed
Reviewed by Alexey Proskuryakov.
Added a check to make sure that resources from a different https origin are not cached. https://bugs.webkit.org/show_bug.cgi?id=33456 Test: http/tests/appcache/different-https-origin-resource-main.html * loader/appcache/ManifestParser.cpp: (WebCore::parseManifest): Canonical link: https://commits.webkit.org/49702@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@58433 268f45cc-cd09-0410-ab3c-d52691b4dbfc
1 parent ec0dc1f commit bcadca5

7 files changed

Lines changed: 82 additions & 0 deletions

File tree

LayoutTests/ChangeLog

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
2010-04-28 Abhishek Arya <inferno@chromium.org>
2+
3+
Reviewed by Alexey Proskuryakov.
4+
5+
Test that a resource from a different https origin is not cached.
6+
https://bugs.webkit.org/show_bug.cgi?id=33456
7+
8+
* http/tests/appcache/different-https-origin-resource-main-expected.txt: Added.
9+
* http/tests/appcache/different-https-origin-resource-main.html: Added.
10+
* http/tests/appcache/resources/different-https-origin-resource.html: Added.
11+
* http/tests/appcache/resources/different-https-origin-resource.manifest: Added.
12+
113
2010-04-28 Evan Martin <evan@chromium.org>
214

315
Reviewed by Adam Roben.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Test that a resource from a different https origin is not cached.
2+
3+
PASS
4+
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<html>
2+
<body>
3+
<script>
4+
if (window.layoutTestController) {
5+
layoutTestController.waitUntilDone();
6+
layoutTestController.dumpAsText();
7+
}
8+
9+
window.addEventListener("message", function(e) {
10+
document.getElementById("result").innerHTML = e.data;
11+
if (window.layoutTestController)
12+
layoutTestController.notifyDone();
13+
}, false);
14+
</script>
15+
<p>Test that a resource from a different https origin is not cached.</p>
16+
<div id=result></div>
17+
<iframe src="https://127.0.0.1:8443/appcache/resources/different-https-origin-resource.html"></iframe>
18+
</body>
19+
</html>
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<html manifest="https://127.0.0.1:8443/appcache/resources/different-https-origin-resource.manifest">
2+
<script>
3+
var hadError = false;
4+
var result;
5+
6+
function finish()
7+
{
8+
if (!hadError)
9+
result = "PASS";
10+
parent.postMessage(result, '*');
11+
}
12+
function fail()
13+
{
14+
result = "FAIL: Different https origin resource is getting downloaded to cache.";
15+
hadError = true;
16+
}
17+
function error()
18+
{
19+
result = "ERROR";
20+
hadError = true;
21+
finish();
22+
}
23+
24+
applicationCache.onprogress = function() { fail(); }
25+
applicationCache.onnoupdate = function() { finish(); }
26+
applicationCache.oncached = function() { finish(); }
27+
applicationCache.onerror = function() { error(); }
28+
</script>
29+
</html>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
CACHE MANIFEST
2+
CACHE:
3+
https://localhost:8443/appcache/resources/simple.txt

WebCore/ChangeLog

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
2010-04-28 Abhishek Arya <inferno@chromium.org>
2+
3+
Reviewed by Alexey Proskuryakov.
4+
5+
Added a check to make sure that resources from a different https origin are not cached.
6+
https://bugs.webkit.org/show_bug.cgi?id=33456
7+
8+
Test: http/tests/appcache/different-https-origin-resource-main.html
9+
10+
* loader/appcache/ManifestParser.cpp:
11+
(WebCore::parseManifest):
12+
113
2010-04-28 Sam Weinig <sam@webkit.org>
214

315
Reviewed by Mark Rowe.

WebCore/loader/appcache/ManifestParser.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,9 @@ bool parseManifest(const KURL& manifestURL, const char* data, int length, Manife
127127
if (!equalIgnoringCase(url.protocol(), manifestURL.protocol()))
128128
continue;
129129

130+
if (mode == Explicit && manifestURL.protocolIs("https") && !protocolHostAndPortAreEqual(manifestURL, url))
131+
continue;
132+
130133
if (mode == Explicit)
131134
manifest.explicitURLs.add(url.string());
132135
else

0 commit comments

Comments
 (0)