Commit graph

76 commits

Author SHA1 Message Date
Keith Yeung
6adc653083 Introduce service-worker mode 2017-06-22 23:48:07 -07:00
Anthony Ramine
16863017a9 Move the HTTP connector in HttpState 2017-04-06 19:35:11 +02:00
Anthony Ramine
949a0827e0 Move the SSL client in HttpState 2017-04-06 18:11:20 +02:00
Josh Matthews
dc99104f55 Add command-line argument to use a custom SSL certificate database. 2017-04-06 19:25:34 +09:00
Anthony Ramine
64ba597a3a Move Arc out of HttpState 2017-04-03 14:00:36 +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
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
ddh
e527c9a991 Update Hyper and OpenSSL 2017-03-31 16:32:21 +02:00
Sumant Manne
8aac575019 Implemented nosniff for fetch algorithm 2017-03-03 15:50:58 +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
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
Nick Price
a56a7baa9a Implement port-based blocking 2016-12-21 09:43:39 -05:00
Ms2ger
6f2606cdee Introduce fetch_with_cors_cache() API for tests. 2016-12-15 10:46:04 +01:00
Ms2ger
a5efc01b5f Use the asynchronous fetching code in unit tests.
This is the only code that is used in Servo proper, so it's a more useful
thing to test.
2016-12-15 10:45:15 +01:00
Ms2ger
c03cd45258 Replace fetch_async() by a new fetch() function.
fetch() returns immediately after processing EOF, at the latest, so not
spinning up a thread should not cause noticeable delays. OTOH, it might
reduce the contention for cores, and reduce the overall time needed.
2016-12-15 10:44:00 +01:00
Ms2ger
9d9f048b3b Introduce fetch_with_context() to reduce repetition. 2016-12-15 10:25:58 +01:00
Alan Jeffrey
9be4fd56ce Removed util. 2016-12-14 18:04:37 -06:00
Ms2ger
621ca6190a Translate a test for ftp URLs to fetch. 2016-11-23 22:34:36 +01:00
Ms2ger
fc26aaf807 Translate a unit test for bogus schemes to fetch. 2016-11-23 22:34:34 +01:00
Ms2ger
f672bf9eab Factor out FileManager::promote_memory(). 2016-11-21 10:37:25 +01:00
Emilio Cobos Álvarez
913c874cb5
Urlmageddon: Use refcounted urls more often. 2016-11-17 18:34:23 +01:00
bors-servo
e3f07dfa16 Auto merge of #14156 - frewsxcv:cors-capitalization, r=KiChjang
Update CORS naming from 'CORS' to 'Cors'.

As per:

https://aturon.github.io/style/naming/README.html#general-conventions-[rfc-#430]

Acronyms should be considered one word and not all caps.

<!-- 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/14156)
<!-- Reviewable:end -->
2016-11-10 14:43:36 -06:00
Ms2ger
15b55c3231 Make Response::url private. 2016-11-10 13:18:43 +01:00
Corey Farwell
bf8752ac9e Update CORS naming from 'CORS' to 'Cors'.
As per:

https://aturon.github.io/style/naming/README.html#general-conventions-[rfc-#430]

Acronyms should be considered one word and not all caps.
2016-11-09 18:30:30 -05:00
Ms2ger
234b47e33e Pass a borrowed fetch context to fetch().
This will allow inspecting its state after fetching in unit tests.
2016-11-08 18:01:23 +01:00
Ms2ger
d777016b3a Use set_default_accept_language in fetch_with_cors_cache. 2016-11-07 19:42:16 +01:00
Ms2ger
b64ca44953 Move make_server to the root of the net unit tests crate. 2016-11-07 15:10:47 +01:00
Ms2ger
277c6d0154 Move ReferrerPolicy to net_traits. 2016-11-04 10:43:37 +01:00
Ms2ger
bb9b0b3467 Move the test_fetch_data test.
There is no longer any point in keeping it apart from the other data URL tests.
2016-11-03 11:54:10 +01:00
Ms2ger
a8f655caf3 Move some helper functions to the root of the net tests crate. 2016-11-03 11:24:15 +01:00
Ms2ger
784c45a306 Store the NetworkError in network error Responses. 2016-11-02 09:20:28 +01:00
Ms2ger
e134871a95 Implement blob url support in the fetch stack. 2016-10-14 14:18:03 +02:00
Ms2ger
fc68e0a6ca Add a FileManager to FetchContext. 2016-10-14 11:30:09 +02:00
Alan Jeffrey
f53408df80 IFrame elements now manage FrameIds rather than the constellation. 2016-10-07 14:11:32 -05:00
Jan Zerebecki
95a7482d26 Remove same-origin-data-url flag from fetch implementation
The spec removed it. Check the scheme instead, data is always same origin now,
except for workers.
This also updates the comments to make step numbers match the spec.
Closes #13362
2016-10-01 00:27:03 -07:00
Nicolas
924136ee0c Fix most typoes for: "referer" -> "referrer" 2016-09-16 12:40:17 -04:00
UK992
93a103ba73 Reorder use statements 2016-09-09 04:55:19 +02:00
Malisa Smith
faf32a7cfb dom::Response implementation 2016-09-06 19:58:32 -07:00
Chiu-Hsiang Hsu
3c93ced76a Solved wrong referrer policy in cors_preflight_fetch 2016-08-27 16:02:23 +08:00
ddh
db808ca75d Added devtools support to fetch for XHR + Manish's XHR ident fix
added unit test for request fetch with devtools

added devtools/fetch test
2016-07-29 11:20:38 +01:00
Manish Goregaokar
ceb85795b1
Use Result instead of panicking when the resource dir can't be found 2016-07-21 12:07:25 +05:30
UK992
5317a716b1 Silent warnings in fetch.rs 2016-06-18 21:52:00 +02:00
Manish Goregaokar
9deecd793c
Review fixes 2016-06-11 11:49:40 +05:30
Manish Goregaokar
fd6f9bd411 Test fixes; update for changes in spec 2016-06-10 20:55:25 +05:30
Manish Goregaokar
bf99e73cb0 Re-add support for fetching chunks (and thus xhr download progress) 2016-06-10 20:53:40 +05:30
Manish Goregaokar
6e29b872d7 Test fixes:
- Hack to stop hitting unreachable on referer
 - add fetch_done to make sync work
 - Make datauris work by setting the response URI, spec bug
 - Allow for empty bodies
 - Make request bodies work (pass to http, fix fencepost in iter count)
2016-06-10 20:53:36 +05:30
Manish Goregaokar
b5255f011e Revamp Fetch async handling to use a fetch target and done channels 2016-06-10 20:53:10 +05:30