Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(221)

Unified Diff: LayoutTests/security/resources/cannot-read-self-from-file.html

Issue 1140203002: make file: an effectively unique origin (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: fix test Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: LayoutTests/security/resources/cannot-read-self-from-file.html
diff --git a/LayoutTests/security/resources/cannot-read-self-from-file.html b/LayoutTests/security/resources/cannot-read-self-from-file.html
new file mode 100644
index 0000000000000000000000000000000000000000..d380284c51226a086a9bb2bb68c11bd4bc3246c6
--- /dev/null
+++ b/LayoutTests/security/resources/cannot-read-self-from-file.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+var req = new XMLHttpRequest();
+req.open('GET', location);
+try {
+ req.send();
+ window.parent.postMessage('FAIL', '*');
+} catch (e) {
+ window.parent.postMessage(e.name, '*');
+}
+</script>
+</head>
+<body>
+Documents loaded from file: shouldn't be able to access themselves via XHR.
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698