servo/components
bors-servo e5b9987917 Auto merge of #13281 - gilbertw1:basic-auth-cache-clean, r=jdm
Update basic auth cache to key off of origin instead of url

This pull request's primary purpose is to store basic auth credentials based on the url origin instead of the entire url. This fixes an issue where servo continuously prompts the user for credentials any time a basic auth secured resource is requested even though the user has already entered auth credentials for a different resource from the same origin.

The test associated with this PR hides image redirects behind a python handler that requires basic authentication. The reference page loads two images by directly specifying the image to load, while the test page loads the two images using the basic auth redirect handler with only the first image tag providing auth credentials.

I'd like to point a few specific items for review:
* url::Origin does not derive ```Hash```, so I am using ```ascii_serialization``` as the cache key. This seems like a stable enough representation.
* I've updated the http loader to store credentials not only on Success responses, but Redirect responses as well. I stumbled on this because nginx was redirecting 'test' -> 'test/' in my testing, and other browsers were storing the credentials on the redirect response vs. prompting for credentials a second time.
* In the test I'm using a timeout to load the second image (without authentication), otherwise the order that the images were loaded was unpredictable.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors related to these changes
- [x] These changes fix #12095  (github issue number if applicable).

<!-- Either: -->
- [x] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/13281)
<!-- Reviewable:end -->
2016-09-16 11:05:52 -05:00
..
canvas Reorder use statements 2016-09-09 04:55:19 +02:00
canvas_traits Update cssparser 2016-09-07 14:13:56 +08:00
compositing Reorder use statements 2016-09-09 04:55:19 +02:00
constellation Auto merge of #12910 - creativcoder:swsender, r=jdm 2016-09-15 08:34:22 -05:00
debugger Implement a WebSocket server for debugging. 2016-09-12 11:02:09 +02:00
devtools Reorder use statements 2016-09-09 04:55:19 +02:00
devtools_traits dom::Response implementation 2016-09-06 19:58:32 -07:00
gfx Reorder use statements 2016-09-09 04:55:19 +02:00
gfx_traits Update euclid to 0.10.1 2016-08-21 03:03:45 +02:00
layout Auto merge of #13214 - shinglyu:gen_trace, r=SimonSapin 2016-09-09 21:13:42 -05:00
layout_thread Auto merge of #13214 - shinglyu:gen_trace, r=SimonSapin 2016-09-09 21:13:42 -05:00
layout_traits Reorder use statements 2016-09-09 04:55:19 +02:00
msg Excise SubpageId and use only PipelineIds 2016-09-13 15:37:38 -04:00
net store basic auth in cache on redirect response 2016-09-15 22:08:52 -04:00
net_traits requestDevice update 2016-09-14 08:41:02 +02:00
plugins Update Rust to 1.13.0-nightly (6ffdda1ba 2016-09-14) 2016-09-15 17:00:56 +02:00
profile Reorder use statements 2016-09-09 04:55:19 +02:00
profile_traits Update serde to 0.8 (fixes #12659) 2016-08-12 18:37:27 +02:00
range Update serde to 0.8 (fixes #12659) 2016-08-12 18:37:27 +02:00
script Auto merge of #13280 - tizianasellitto:issue_13019, r=jdm 2016-09-15 18:33:53 -05:00
script_layout_interface Reorder use statements 2016-09-09 04:55:19 +02:00
script_traits Auto merge of #13278 - servo:rustup, r=jdm 2016-09-15 12:37:47 -05:00
servo Update webrender + shaders. 2016-09-16 11:01:24 +10:00
style Auto merge of #13188 - canaltinova:matrix, r=Manishearth 2016-09-16 05:01:23 -05:00
style_traits Reorder use statements 2016-09-09 04:55:19 +02:00
util Update webrender + shaders. 2016-09-16 11:01:24 +10:00
webdriver_server Use fn pipeline_id consistently, not fn pipeline 2016-09-13 15:17:40 -04:00