Commit graph

127 commits

Author SHA1 Message Date
Josh Matthews
7bf2e19437 Make the net monitor panel in FF's devtools show meaningful output.
0) Advertise support for the network monitor in the initial protocol communication.
1) Only notify the developer tools server about the final request in an HTTP transaction.
2) Add timing information for connecting to the HTTP server and sending the HTTP request.
3) Reduce duplication between various networkEventUpdate structures by creating a helper function
that merges two JSON structures together. This also corrects the JSON structure so the devtools
client interprets the output correctly.
4) Calculate various header size fields correctly.
5) Remove unnecessary usize->u32 casts by making the appropriate fields usize.
6) Add header values to request and response header messages.
7) Support triggering page reloads via the devtools client.
2016-06-06 00:51:36 +01:00
Josh Matthews
074fc4a5e1 Process content blocker rules in the HTTP loader. 2016-05-30 13:17:42 +02:00
Josh Matthews
3cb8af20c2 Remove empty lines following braces. 2016-05-27 13:32:05 -04:00
Rahul Sharma
3766cd1673 adding interface for custom responses 2016-05-20 12:11:56 +05:30
Josh Matthews
cb63ad6c87 Add the requesting URL to the 401 prompt. Only show the 401 prompt when the WWW-Authenticate header is present. 2016-05-03 13:19:42 -04:00
bors-servo
81f6e70a62 Auto merge of #10785 - frewsxcv:loaderrortype-nostring, r=jdm
Refactor `LoadErrorType` to not require a `String` for every type.

Some of the `LoadErrorType` like `LoadCancelled` don't need a `String`
associated with the type since the variant is self-explanatory.

There are some variants that don't need an associated `String`, but that
can be cleaned up in a later refactor. Also, `net_traits::NetworkError`
currently requires a `String`, but that can potentially also be
refactored away too.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10785)
<!-- Reviewable:end -->
2016-04-25 14:37:44 -07:00
Corey Farwell
2675d9d1ff Refactor LoadErrorType to not require a String for every type.
Some of the `LoadErrorType` like `LoadCancelled` don't need a `String`
associated with the type since the variant is self-explanatory.

There are some variants that don't need an associated `String`, but that
can be cleaned up in a later refactor. Also, `net_traits::NetworkError`
currently requires a `String`, but that can potentially also be
refactored away too.
2016-04-25 17:10:33 -04:00
Rebecca
526525b835 Add referrer policy pass-through and referrer header logic
add pass-through from doc to http-loader for referrer_policy, ref_URL
add logic for setting referer header
add script pass-through for referrer
add unit tests for setting referer header
2016-04-25 16:41:06 -04:00
Simon Sapin
7932ab6ac2 Upgrade to rust-url 1.0 and hyper 0.9 2016-04-23 20:27:58 +02:00
Daniel
d4f63cda5f write cookie_jar, hsts_list, auth_cache, and local_data to file if profile_dir option is present 2016-04-20 18:12:00 -04:00
Josh Matthews
d888ed368d Make new test use local resources only. 2016-04-20 12:38:38 -04:00
Ravi Shankar
945a2c66e1 Updated the unit tests to include NetworkError 2016-04-20 12:38:36 -04:00
Corey Farwell
7500307e80 Avoid unnecessary net_traits::LoadData clone. 2016-04-18 22:53:28 -04:00
Corey Farwell
da0adeb0ac Verify number of redirects when we reach limit. 2016-04-17 20:14:08 -04:00
Corey Farwell
08fc002f41 Rename 'HSTS*' structures to 'Hsts*'.
"In CamelCase, acronyms count as one word: use Uuid rather than UUID."

-- https://doc.rust-lang.org/style/style/naming/README.html
2016-04-17 14:12:28 -04:00
Josh Matthews
43369fa897 Rename create_with_headers to create. 2016-04-15 01:46:04 -04:00
Josh Matthews
a761f2bed4 Remove unused header manipulation facilities. 2016-04-15 01:46:03 -04:00
Josh Matthews
4cb7dfbc59 Convert remaining factories that don't make use of headers. 2016-04-15 01:46:02 -04:00
Josh Matthews
d1b07673b8 Convert AssertMustNotIncludeHeadersRequestFactory. 2016-04-15 01:46:01 -04:00
Josh Matthews
f712ddb0db Convert AssertAuthHeaderRequestFactory. 2016-04-15 01:46:00 -04:00
Josh Matthews
36de07bfdf Convert AssertMustIncludeHeadersRequestFactory. 2016-04-15 01:45:58 -04:00
Josh Matthews
dec66b2215 Convert AssertMustHaveHeadersRequestFactory. 2016-04-15 01:45:57 -04:00
Josh Matthews
dc790048ec Remove unnecessary type annotations. 2016-04-15 01:00:44 -04:00
Daniel
b0e1f10ba5 401 authorization UI then restart request/save successful auth creds 2016-04-14 21:38:45 -04:00
Simon Sapin
6889f37d9e Remove the url! plugin.
In rust-url 1.0 the `Url` struct is going to have private fields, and there
is no way to to create an aribitrary one without going through the parser.

The plugin never had a clear demonstrated performance benefit,
it was made mostly because it was possible and relatively easy at the time.
2016-04-14 15:35:28 +02:00
Josh Matthews
97f25456ef Fix HTTP unit test warnings. 2016-03-28 23:16:12 -04:00
Connor Brewster
b09570b2b6 Added global state struct
Replace hsts_list, auth_cache, and cookie_jar with http_state

Reverted a few changes

Moved http_state back to factory
Removed unnecessary Arc

Removed Arc for http_state
2016-03-25 12:35:40 -06:00
Daniel
d49d3b01f2 add auth cache to resources + set auth header if url does not have creds 2016-03-24 12:24:08 -04:00
Bob
248e84e928 create cookie as HTTP instead of NonHttp in test
Cleanup for readability and correctness of unit test in http_loader
2016-03-03 17:16:07 +00:00
Bob
759099c78d correctly send secure cookies after hsts url match
Fix for #8100, where sites in the hsts list were not recieving secure
cookies if the site was originally loading using a plain http url.
2016-02-27 15:16:53 +00:00
bors-servo
6d8c018f6b Auto merge of #9039 - askalski:tests_to_http_loader, r=jdm
added tests to http_loader, veryfing if redirects use correct cookies

this is second PR, following https://github.com/servo/servo/pull/7617 .

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9039)
<!-- Reviewable:end -->
2016-02-26 02:04:01 +05:30
rohan.prinja
1f02c4ebbb task -> thread 2016-01-10 17:58:13 +09:00
askalski
715fbd76c0 added tests to http_loader, veryfing if redirects use correct cookies 2015-12-31 22:23:23 +01:00
bors-servo
61314f5253 Auto merge of #9104 - vwvww:issue_9098, r=nox
Refactor AssertRequestsMustNotHaveHeaders

Improve correctness of AssertRequestMustNotHaveHeaders tests
 - Changed AssertRequestsMustNotHaveHeaders to AssertRequestMustNotIncudeHeaders
 - Added an assertion that headers_not_expected is not empty

tested by command
./mach test unit
and all passed.

resolves #9098

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9104)
<!-- Reviewable:end -->
2016-01-01 02:20:05 +05:30
David Rajchenbach-Teller
1e81b8c133 Resolves #4183 - Implemementing context-based MIME type sniffing
The version of the standard is not finalized at the time of this writing.
Specifications may be found here: https://mimesniff.spec.whatwg.org/#context-specific-sniffing .
2015-12-31 07:45:03 -05:00
Beomjin Kim
b90a836071 Refactor AssertRequestsMustNotHaveHeaders to AssertRequestMustNotIncludeHeaders
Improve correctness of AssertRequestMustNotHaveHeaders tests
resolves #9098
2015-12-31 13:05:09 +09:00
Abhishek Kumar
f889b1ccd7 Support responseCookies, responseContent, responseHeaders, requestCookies, getResponseHeaders,
getResponseContent, getRequestPostData, getRequestCookies, getResponseCookies, getEventTimings and
getSecurityInfo message for network devtools

Fixing Indentation
2015-12-21 10:28:40 -05:00
Corey Farwell
f34da4120d Implement 'url!(..)' macro
https://github.com/servo/rust-url/issues/136

https://github.com/servo/rust-url/pull/137
2015-11-21 08:15:56 -05:00
Ravi Shankar
afb9b0707b Testing cancellation during redirects 2015-11-14 10:04:32 +05:30
João Oliveira
79fcd1da95 Write unit tests for cookie isolation 2015-11-12 14:12:08 +00:00
Abhishek Kumar
de4f8ea4e6 Improve HTTP monitoring devtool support 2015-11-05 00:17:24 -05:00
Abhishek Kumar
b7de946205 Check in for task 1,4 and 5
Adding pipelineID to httpresponse message, clearner code for task1

Commit for Refactored task

Unit tests

Removing extra whitespaces.

Removing extra whitespaces.

Removing tabs whitespaces

Making Code tidier.

Style issues Fix

Test-tidy Fixes
2015-11-05 00:17:24 -05:00
nxnfufunezn
468eaac096 Accept Brotli-compressed HTTP responses #8156 2015-11-01 08:59:18 +05:30
bors-servo
48887acff1 Auto merge of #7939 - iawaknahc:issue-7924, r=Manishearth
Use typed headers API instead of set_raw

fix https://github.com/servo/servo/issues/7924

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7939)
<!-- Reviewable:end -->
2015-10-09 15:01:22 -06:00
Louis Chan
aa6378a462 Use typed headers API instead of set_raw 2015-10-09 17:25:14 +08:00
Antonio de Luna
6c4a849e4e removed &mut and clone 2015-10-09 01:35:03 -07:00
Prabhjyot Singh Sodhi
d27c126013 renaming AssertRequstMustHaveHeaders to AssertRequestMustIncludeHeaders 2015-10-07 22:59:47 +05:30
Prabhjyot Singh Sodhi
920bb5e4b8 tests for devtools integration with network requests/responses 2015-09-25 22:07:01 +05:30
Sam Gibson
641119206e Remove superfluous clone 2015-09-19 19:13:51 +12:00
Sam Gibson
6d20b388f6 General cleanup for HSTS/Cookie Arc 2015-09-19 18:30:38 +12:00