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

Unified Diff: LayoutTests/http/tests/security/resources/img-basic-auth.php

Issue 450263002: Test <img crossorigin> handling of 401 responses. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 4 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
« no previous file with comments | « LayoutTests/http/tests/security/img-crossorigin-no-credentials-prompt-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/http/tests/security/resources/img-basic-auth.php
diff --git a/LayoutTests/http/tests/security/resources/img-basic-auth.php b/LayoutTests/http/tests/security/resources/img-basic-auth.php
new file mode 100644
index 0000000000000000000000000000000000000000..3f60617c7ff8e76bfef971ad5f60cf44e85f2e36
--- /dev/null
+++ b/LayoutTests/http/tests/security/resources/img-basic-auth.php
@@ -0,0 +1,15 @@
+<?php
+if (!isset($_SERVER['PHP_AUTH_USER']) || !isset($_REQUEST['uid']) || $_REQUEST['uid'] != $_SERVER['PHP_AUTH_USER']) {
+ header('WWW-Authenticate: Basic realm="blink test realm"');
+ header('HTTP/1.0 401 Unauthorized');
+ echo 'Authentication cancelled.';
+} else {
+ header("Access-Control-Allow-Origin: *");
+ $name = 'abe.png';
+ $fp = fopen($name, 'rb');
+ header("Content-Type: image/png");
+ header("Content-Length: " . filesize($name));
+ header('HTTP/1.0 200 OK');
+ fpassthru($fp);
+}
+?>
« no previous file with comments | « LayoutTests/http/tests/security/img-crossorigin-no-credentials-prompt-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698