Skip to content
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
merged 4 commits into from Sep 16, 2016
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Prev

removed race condition possibility from auth cache test & fixed up te…

…st errors
  • Loading branch information
gilbertw1 committed Sep 16, 2016
commit 715682c3a8848db945f0ccf4911c3d54e591dce8
@@ -1533,7 +1533,7 @@ fn test_if_auth_creds_not_in_url_but_in_cache_it_sets_it() {
password: "test".to_owned(),
};

http_state.auth_cache.write().unwrap().entries.insert(url.origin().clone(), auth_entry);
http_state.auth_cache.write().unwrap().entries.insert(url.origin().clone().ascii_serialization(), auth_entry);

let mut load_data = LoadData::new(LoadContext::Browsing, url, &HttpTest);
load_data.credentials_flag = true;
"deleted": [],
"deleted_reftests": {},
"items": {
"testharness": {
"dom/lists/DOMTokenList-Iterable.html": [
{
"path": "dom/lists/DOMTokenList-Iterable.html",
"url": "/dom/lists/DOMTokenList-Iterable.html"
}
]
},
"reftest": {
"http/basic-auth-cache-test.html": [
{
"url": "/http/basic-auth-cache-test.html"
}
]
},
"testharness": {
"dom/lists/DOMTokenList-Iterable.html": [
{
"path": "dom/lists/DOMTokenList-Iterable.html",
"url": "/dom/lists/DOMTokenList-Iterable.html"
}
]
}
},
"reftest_nodes": {
"http/reftest-basic-auth-cache-test.html": [
"http/basic-auth-cache-test.html": [
{
"path": "http/basic-auth-cache-test.html",
"references": [
@@ -1,6 +1,9 @@
<!doctype html>
<meta charset="utf-8">
<html>
<head>
<meta charset="utf-8">
</head>

<img src="resources/image.png">
<img src="resources/image.png">
</html>
@@ -1,15 +1,30 @@
<!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>
<html id="doc" class="reftest-wait">
<head>
<meta charset="utf-8">
</head>

<link rel="match" href="basic-auth-cache-test-ref.html">

<img id="auth" onload="loadNoAuth()">
<img id="noauth" onload="removeWait()">


<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() {
var noAuthImg = '<img src="http://' + window.location.host + '/http/resources/securedimage.py">';
document.getElementById('noauth').innerHTML = noAuthImg;
}, 100);
function loadAuth() {
var authUrl = 'http://testuser:testpass@' + window.location.host + '/http/resources/securedimage.py';
document.getElementById('auth').src = authUrl;
}

function loadNoAuth() {
var noAuthUrl = 'http://' + window.location.host + '/http/resources/securedimage.py';
document.getElementById('noauth').src = noAuthUrl;
}

function removeWait() {
document.getElementById('doc').className = "";
}

window.onload = loadAuth;
</script>
</html>
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.