New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update basic auth cache to key off of origin instead of url #13281
Merged
+95
−10
Merged
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
82e45a4
updated basic auth cache to key off of url origin
gilbertw1 0bcd04d
store basic auth in cache on redirect response
gilbertw1 712b1d5
added test that verifies proper basic auth caching behavior
gilbertw1 715682c
removed race condition possibility from auth cache test & fixed up te…
gilbertw1 File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.
added test that verifies proper basic auth caching behavior
- Loading branch information
commit 712b1d5ea0eb9625a9e868673bc9d172f84b9ada
| "url": "/dom/lists/DOMTokenList-Iterable.html" | ||
| } | ||
| ] | ||
| }, | ||
| "reftest": { | ||
| "http/basic-auth-cache-test.html": [ | ||
| { | ||
| "path": "http/basic-auth-cache-test.html", | ||
| "references": [ | ||
| [ | ||
| "/http/basic-auth-cache-test-ref.html", | ||
| "==" | ||
| ] | ||
| ], | ||
| "url": "/http/basic-auth-cache-test.html" | ||
| } | ||
| ] | ||
| } | ||
| }, | ||
| "reftest_nodes": {} | ||
| "reftest_nodes": { | ||
| "http/reftest-basic-auth-cache-test.html": [ | ||
| { | ||
| "path": "http/basic-auth-cache-test.html", | ||
| "references": [ | ||
| [ | ||
| "/http/basic-auth-cache-test-ref.html", | ||
| "==" | ||
| ] | ||
| ], | ||
| "url": "/http/basic-auth-cache-test.html" | ||
| } | ||
| ] | ||
| } | ||
| }, | ||
| "reftest_nodes": { | ||
| "2dcontext/building-paths/canvas_complexshapes_arcto_001.htm": [ |
| @@ -0,0 +1,6 @@ | ||
| <!doctype html> | ||
| <meta charset="utf-8"> | ||
| <html> | ||
| <img src="resources/image.png"> | ||
| <img src="resources/image.png"> | ||
| </html> |
| @@ -0,0 +1,15 @@ | ||
| <!doctype html> | ||
| <meta charset="utf-8"> | ||
| <link rel="match" href="basic-auth-cache-test-ref.html"> | ||
|
||
| <html> | ||
| <div id="auth"> </div> | ||
| <div id="noauth"> </div> | ||
| <script type="text/javascript"> | ||
| var authImg = '<img src="http://testuser:testpass@' + window.location.host + '/http/resources/securedimage.py">'; | ||
| document.getElementById('auth').innerHTML = authImg; | ||
| setTimeout(function() { | ||
jdm
Member
|
||
| var noAuthImg = '<img src="http://' + window.location.host + '/http/resources/securedimage.py">'; | ||
| document.getElementById('noauth').innerHTML = noAuthImg; | ||
| }, 100); | ||
| </script> | ||
| </html> | ||
Binary file not shown.
| @@ -0,0 +1,17 @@ | ||
| # -*- coding: utf-8 - | ||
|
|
||
| def main(request, response): | ||
| image_url = str.replace(request.url, "securedimage.py", "image.png") | ||
|
|
||
| if "authorization" not in request.headers: | ||
| response.status = 401 | ||
| response.headers.set("WWW-Authenticate", "Basic") | ||
| return response | ||
| else: | ||
| auth = request.headers.get("Authorization") | ||
| if auth != "Basic dGVzdHVzZXI6dGVzdHBhc3M=": | ||
| response.set_error(403, "Invalid username or password - " + auth) | ||
| return response | ||
|
|
||
| response.status = 301 | ||
| response.headers.set("Location", image_url) |
ProTip!
Use n and p to navigate between commits in a pull request.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Oh, these elements should be children of the
<html>element.