Commit graph

382 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
Bastien Orivel
76d8573393 Bump serde to 1.0 2017-06-16 13:31:18 +02:00
Simon Sapin
008e733df6 Fix some "unused" warnings 2017-06-06 16:58:35 +02: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
6f590a87bf Move hosts module into net crate. Remove obsolete functions. 2017-04-06 19:25:47 +09: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
170bcfc03e Kill hsts::secure_url 2017-04-05 14:42:49 +02: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
Anthony Ramine
bc5c4fa892 Rework replace_hosts and host_replacement
They do less cloning now.
2017-03-26 16:14:22 +02:00
Matt Brubeck
8f65463ffa Upgrade dependencies with minor updates 2017-03-17 07:38:27 -07:00
bors-servo
a11a3fe68b Auto merge of #15903 - servo:set-origin-header, r=Wafflespeanut
Set Origin header in http_network_or_cache_fetch

<!-- 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/15903)
<!-- Reviewable:end -->
2017-03-09 22:15:11 -08: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
c1e8beacdc Remove unused content-blocker dependency from unit tests. 2017-03-09 10:29:34 +01:00
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
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
Anthony Ramine
63c4490e73 Kill the plugins crate and its clippy support
Sometimes clippy gets outdated by months, and its current support setup
means that each Servo component need to opt into it by depending on
the plugins crate manually, and not all components do that.
2017-02-21 11:50:36 +01:00
Anthony Ramine
fe3f4ff0c2 Update serde to 0.9 (fixes #15325) 2017-02-18 21:09:46 +01:00
Anthony Ramine
85e2648ffc Update ipc-channel to 0.6.3 2017-02-16 12:04:32 +01:00
bors-servo
f1c82be0e6 Auto merge of #14868 - bd339:iss14068, r=jdm
Fix loss of response type information in Fetch API

<!-- Please describe your changes on the following line: -->
Avoids mapping response types that are distinct according to [the spec](https://fetch.spec.whatwg.org/#concept-response-type) to fewer response types. Also updates test expectations to match that we now pass tests that check the response type.

---
<!-- 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
- [X] These changes fix #14068

<!-- Either: -->
- [X] There are tests for these changes

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- 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/14868)
<!-- Reviewable:end -->
2017-01-09 18:36:38 -08:00
bd339
0f1eb13e33 Don't lose information in Fetch API
Also update test expectations.
2017-01-09 14:52:14 +01: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 Brubeck
f6e7179e9a Fix an unused variable warning in net_tests 2016-12-30 17:24:10 -08:00
Raghav
6a14349eb1 Refactor HSTSList to use HashMap
Refactored HSTSList to use HashMap, where the key of HashMap is the base
domain. Every time when we check if a host is secure, we find the base
domain of the host and get a vector of HSTS entries associated with the
base domain.

While this will not give O(1) look up time, we would have a smaller list
to iterate for every lookup. I have added one unit test to validate
HashMap changes.
2016-12-30 22:00:03 +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
bors-servo
de7d73adb0 Auto merge of #14623 - DominoTree:master, r=emilio
<!-- Please describe your changes on the following line: -->
Add check for bad ports to http_fetch(), return NetworkError::Internal if bad port/schema combination is seen.

Test added

---
<!-- 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
- [x] These changes fix #14514 (github issue number if applicable).

<!-- Either: -->
- [x] There are tests for these changes OR

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- 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/14623)
<!-- Reviewable:end -->
2016-12-24 03:41:14 -08:00
Keith Yeung
16f1947e24 Add unit tests 2016-12-22 11:29:30 -08:00
Nick Price
a56a7baa9a Implement port-based blocking 2016-12-21 09:43:39 -05:00
Ms2ger
217f44b67a Make the fetch target non-optional. 2016-12-15 10:49:04 +01:00
Ms2ger
6f2606cdee Introduce fetch_with_cors_cache() API for tests. 2016-12-15 10:46:04 +01:00
Ms2ger
306905a631 Use the asynchronous fetching code for fetch_with_context(). 2016-12-15 10:45:40 +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
Ms2ger
8d34ef109d Qualify the fetch() calls in unit tests. 2016-12-15 10:25:27 +01:00
Alan Jeffrey
9be4fd56ce Removed util. 2016-12-14 18:04:37 -06:00
Raghav
c1518adba8 Redesign CookieStorage and Implement Leave Secure Cookie Alone
CookieStorage has been refactored to use HashMap with base domain as the
key. Values of hashmap is vector of cookies.
CookieStorage now has max_per_host which restricts maximum cookies that
can be added per base domain.
Cookie eviction doesnot take place if max_per_host is not reached.
Cookie eviction logic implemented here does following steps
1) Evict all expired cookies
2) Remove oldest accessed non-secure cookie If any
3) When no non-secure cookie exist, remove oldest accessed secure cookie
if new cookie being added is secure. Else ignore new cookie
2016-12-04 16:29:38 -05:00
Ms2ger
761524c01b Remove some unused arguments.
The change to the unit test is necessary because the resource thread is not
resilient against either of these Senders being dropped while the resource
thread is running. Before this change, it held clones of those senders itself
(public_setup_chan_clone, private_setup_chan_clone).
2016-11-24 11:46:33 +01:00
Ms2ger
7913f3adaf Remove the unused CancellationListener arguments in filemanager_thread. 2016-11-24 11:46:30 +01:00
Ms2ger
ce24edc2b3 Remove a test for the CoreResourceMsg::Cancel message. 2016-11-24 11:46:23 +01:00
Ms2ger
2dc73d8789 Rewrite test_redirect_from_x_to_x_provides_x_with_cookie_from_first_response. 2016-11-23 22:35:33 +01:00
Ms2ger
f4f125852a Remove references to https from http_loader unit tests. 2016-11-23 22:34:39 +01:00
Ms2ger
adc78c7cbe Remove a test for view-source.
This scheme is not currently supported in fetch (#14308).
2016-11-23 22:34:38 +01:00