Commit graph

412 commits

Author SHA1 Message Date
Keith Yeung
6adc653083 Introduce service-worker mode 2017-06-22 23:48:07 -07:00
Simon Sapin
316cd35767 Untry 2017-06-18 13:21:51 +02:00
Josh Matthews
fe74460bae Read 32kb from the network at a time. 2017-06-05 13:47:39 -04:00
Nikhil Shagrithaya
541baafe1c Redirect document loads manually 2017-05-31 17:28:53 +05:30
Josh Matthews
525e9c08c8 Show HTTP response headers in debug output. 2017-04-17 11:47:08 +10:00
Anthony Ramine
9394469ede Kill Request::omit_origin_header 2017-04-07 12:52:50 +02:00
Anthony Ramine
16863017a9 Move the HTTP connector in HttpState 2017-04-06 19:35:11 +02:00
Anthony Ramine
12ddc891c6 Pass a &Pool<Connector> to http_loader::obtain_response 2017-04-06 18:50:45 +02:00
Anthony Ramine
949a0827e0 Move the SSL client in HttpState 2017-04-06 18:11:20 +02:00
Josh Matthews
ba132e0b4c Remove unnecessary NetworkHttpRequestFactory abstraction. 2017-04-06 19:25:39 +09:00
Josh Matthews
e9fdc4c72a Replace hosts when making TCP connections, not when verifying SSL certs. 2017-04-06 19:25:37 +09:00
Josh Matthews
6079dd4de7 Enable HTTP connection pooling. Retry stale connections indicated by connection reset errors. 2017-04-04 19:40:46 -04:00
Anthony Ramine
901877da1a Introduce http_loader::set_default_accept 2017-04-04 13:17:18 +02:00
Anthony Ramine
64ba597a3a Move Arc out of HttpState 2017-04-03 14:00:36 +02:00
Anthony Ramine
8683f4d43e Reuse HttpState in ResourceGroup 2017-04-03 12:47:35 +02:00
Anthony Ramine
016fee016b Move the HTTP connector to FetchContext 2017-04-03 12:47:33 +02:00
Anthony Ramine
7b16021a89 Make Response::url_list be a bare Vec<ServoUrl> 2017-04-03 12:47:28 +02:00
Anthony Ramine
80e02303d3 Make Response::internal_response a bare boolean 2017-04-03 12:39:11 +02:00
Anthony Ramine
cb2eb81208 Remove all internal mutability from Request 2017-04-03 12:39:07 +02:00
Anthony Ramine
f42a63baea Make fetch take a &Request 2017-04-03 12:33:43 +02:00
Anthony Ramine
9601a66b60 Make cors_preflight_fetch take a &Request 2017-04-03 11:09:39 +02:00
Anthony Ramine
d5cbdffe37 Make cors_check take a &Request 2017-04-03 11:09:38 +02:00
Anthony Ramine
20e0b6cd56 Introduce create_ssl_client
This lets us reuse the same SSL context for all HTTPS requests.
2017-04-02 15:27:40 +02:00
ddh
e527c9a991 Update Hyper and OpenSSL 2017-03-31 16:32:21 +02:00
Anthony Ramine
f66cae3f96 Revert "Introduce create_ssl_context"
This reverts commit 7a4632bfa2.
2017-03-31 16:19:00 +02:00
bors-servo
0f9dbcc808 Auto merge of #16156 - ferjm:issue-16130-http-network-or-cache-fetch, r=jdm
Update http_network_or_cache_fetch according to spec

There are still many steps blocked by the absence of an HTTP cache and the inability to trigger a credentials dialog.

- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #16130

<!-- 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/16156)
<!-- Reviewable:end -->
2017-03-29 19:38:45 -05:00
Anthony Ramine
d022535f9c Make the WebSocket handshake ourselves to ease switching libs
We need to switch to tungstenite to finally update openssl, this commit
rewrites the whole websocket infrastructure to properly follow the Fetch
spec and to make switching to a different websocket library easier.
2017-03-29 19:17:27 +02:00
Anthony Ramine
3ed32f8078 Introduce NetworkError::from_hyper_error and from_ssl_error 2017-03-29 18:01:01 +02:00
Anthony Ramine
7a4632bfa2 Introduce create_ssl_context 2017-03-28 00:37:25 +02:00
Fernando Jiménez Moreno
d919f55884 Update http_network_or_cache_fetch according to spec 2017-03-27 19:45:05 +02:00
Anthony Ramine
e2e2d42e38 Introduce http_loader::is_redirect_status 2017-03-27 14:51:10 +02:00
Anthony Ramine
b096bf4806 Use Url::port instead of Url::port_or_known_default to set Host
AFAIK, if there is no explicit port in the request URL, there should be
no explicit port in the Host header.
2017-03-26 16:15:10 +02:00
Anthony Ramine
92c4a43946 Use NetworkConnector directly to account for replaced hosts
This let us remove a hack where we had to replace the host in the request URL.
2017-03-26 16:15:09 +02:00
Anthony Ramine
54d37d920c Remove some useless Option<T> wrappers from ServoUrl methods 2017-03-26 16:15:06 +02:00
Anthony Ramine
bc5c4fa892 Rework replace_hosts and host_replacement
They do less cloning now.
2017-03-26 16:14:22 +02:00
Fernando Jiménez Moreno
469eb192c5 Allow for redirects after a CORS-preflight 2017-03-10 16:39:33 +01:00
rabisg
de2b9b7707 Fixes #14787: Set Origin header in http_network_or_cache_fetch
Sets Origin header on request with CORS flag set or on requests other
than those with GET/HEAD methods
2017-03-10 11:44:21 +05:30
Ms2ger
5a61d8b2ea Remove unused content blocker code.
I don't know what it is for, so I believe it would be better to remove it
entirely until and unless we start using it.
2017-03-07 10:29:27 +01:00
Connor Brewster
bfd7b950ad Add ImmutableOrigin to allow for serializing origins 2017-02-22 11:11:59 -06:00
mrnayak
a3026499f4 Implement Subresource Integrity
Implemented response validation part of
https://w3c.github.io/webappsec-subresource-integrity/.
Implemented step eighteen of the main fetch. If a request has integrity
metadata, then following steps are performed
*Wait for response body
*If the response does not have a termination reason and response does not
match request’s integrity metadata, set response to a
network error.# Please enter the commit message for your changes. Lines starting
2017-01-08 08:52:18 +05:30
Matt McCoy
09194a15ac Updating http_network_or_cache_fetch to better match the fetch API spec 2017-01-02 12:00:57 -05:00
Raghav
6020b4c15c Implement HSTS fetch step
Implemented step nine of the main fetch. If current URL scheme is 'HTTP'
and current URL's host is domain and if current URL's host matched with
Known
HSTS Host Domain Name Matching results in either a superdomain match with
an asserted includeSubDomains directive or a congruent match then we
change request scheme to 'https'. This change has been made in method.rs

A test case to validate this has been added in fetch.rs. For asserting
https scheme, a https localhost was required. For this purpose I have
created a self-signed certificate and refactored fetch-context and
connector.rs to programmatically trust this certificate for running this
test case.
2016-12-29 12:55:31 +05:30
Matt McCoy
ed075ab552 Reuse the http connector pool between fetches 2016-12-26 19:39:11 -05:00
Keith Yeung
63a7e8efdf Add domain and path checks for secure cookies eviction 2016-12-21 03:39:38 -08:00
Ms2ger
217f44b67a Make the fetch target non-optional. 2016-12-15 10:49:04 +01:00
Ms2ger
8a4a5c0cb5 Avoid unlocking the response body while it is in an inconsistent state. 2016-12-15 10:12:13 +01:00
Alan Jeffrey
9be4fd56ce Removed util. 2016-12-14 18:04:37 -06:00
bors-servo
882d5512bb Auto merge of #14508 - servo:determine_request_referrer, r=jdm,frewsxcv
Rewrite determine_request_referrer() to explicitly limit it to the checks it can do.

Checks for the Client value should reside in the script thread.

I also noted some other issues in this code.

<!-- 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/14508)
<!-- Reviewable:end -->
2016-12-09 13:13:27 -08:00
bors-servo
da2f41ba13 Auto merge of #14502 - servo:filter-map, r=frewsxcv
Replace an unidiomatic use of filter_map().

<!-- 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/14502)
<!-- Reviewable:end -->
2016-12-08 15:12:42 -08:00
bors-servo
fffdcc1d7d Auto merge of #14501 - servo:LoadError, r=Manishearth
Remove LoadError.

<!-- 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/14501)
<!-- Reviewable:end -->
2016-12-08 14:22:17 -08:00