Commit graph

113 commits

Author SHA1 Message Date
Ravi Shankar
afb9b0707b Testing cancellation during redirects 2015-11-14 10:04:32 +05:30
Ravi Shankar
c4cf72db6e Added support for synchronization along with an unit test for cancellation listener 2015-11-12 14:04:38 +05:30
Ravi Shankar
10f5584f78 Implement cancellation listener for cancelling network requests 2015-11-12 14:02:59 +05:30
Eli Friedman
aef06f2f20 Consistently use content-type sniffing with all protocols. 2015-10-31 11:26:17 -07:00
bors-servo
f35f809938 Auto merge of #7984 - eefriedman:net-send-error, r=jdm
Refactor resource loaders to use send_error utility.

No substantial functional change.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7984)
<!-- Reviewable:end -->
2015-10-14 13:28:14 -06:00
bors-servo
7308d0dd0d Auto merge of #7967 - eefriedman:mime-handling, r=jdm
MIMEClassifier::classify always succeeds; fix the type to reflect this.



<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7967)
<!-- Reviewable:end -->
2015-10-14 08:46:32 -06:00
Eli Friedman
1c4962288c MIMEClassifier::classify always succeeds; fix the type to reflect this. 2015-10-13 18:03:40 -07:00
Eli Friedman
10664cf3f4 Refactor resource loaders to use send_error utility.
No substantial functional change.
2015-10-13 16:37:12 -07:00
David Raifaizen
43a0651761 Removed user agent parameter from being unnecessarily passed 2015-10-13 18:17:26 -04:00
Corey Farwell
20beaf5af3 Fix issues found by rust-clippy 2015-10-12 20:21:49 -04:00
Corey Farwell
81e034885b Cleanup code that was warned by rust-clippy 2015-10-11 20:47:45 -04:00
Jaydeep
2a99915188 Check for Extra pointer dereferencing. Issue #7640. 2015-09-26 19:33:29 -07:00
Ravi Shankar
889eec364b sorted the extern crate, mod & use declarations 2015-09-24 02:12:45 +05:30
Maciej Skrzypkowski
88815d21ba Add plugins for compositing and net crates #7699
Changed to_string calls to to_owned calls
where was a need.
2015-09-22 13:51:21 +02:00
Sam Gibson
6d20b388f6 General cleanup for HSTS/Cookie Arc 2015-09-19 18:30:38 +12:00
Sam Gibson
6f573d5d44 Move HSTS/CookieStorage to Arc<RwLock> from Ipc
servo/servo#7421
2015-09-19 18:30:37 +12:00
bors-servo
8a8204ffc8 Auto merge of #7447 - ddrmanxbxfr:master, r=jdm
Issue #7382 Use descriptive enums instead of booleans for MIMEClassifier::classifer

Hi guys i've done a small pass of refactor in the MIMEClassifier implementation. (See issue #7382 )
   - Moved the predicates to separate functions
   - Added a mimetype enum so we can compare them easily after calling MIMEClassifier::get_media_type

I hope it follows rust good pratices (care it's my first time doing rust).

Improvements and tips are welcome :).

Thanks for looking at it.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7447)
<!-- Reviewable:end -->
2015-09-18 07:22:59 -06:00
João Oliveira
813cdaa012 Move setting UserAgent header into http_loader::load,
closes #7541
2015-09-14 15:35:34 +01:00
Mathieu Rheaume
5c807311de Remove unused import in components/net/resource_task.rs 2015-09-12 17:44:15 -04:00
Mathieu Rheaume
8525495265 Issue #7382 Use descriptive enums instead of booleans for MIMEClassifier::classifer 2015-09-12 17:44:14 -04:00
Sean McArthur
a1a9db8ffd net: use connection pooling 2015-09-02 12:46:53 -04:00
Sam Gibson
c093ce8a5a Only use the resource manager's HSTS list.
Simplifies a bunch of stuff.
2015-08-30 12:14:02 +10:00
Johann Tuffe
ec07178b6f sort all uses 2015-08-20 20:47:12 +08:00
bors-servo
0d6d6a0500 Auto merge of #7257 - jxs:master, r=Ms2ger
Replace uses of `for foo in bar.iter()`,

and `for foo in bar.iter_mut(), and for foo in bar.into_iter()
(continuation of #7197)

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7257)
<!-- Reviewable:end -->
2015-08-18 02:46:46 -06:00
Glenn Watson
6d9fccbae7 Add a simple method to emulate a platform UA (e.g. pretend a desktop build is an android UA). 2015-08-18 14:42:28 +10:00
João Oliveira
067a22a868 Replace uses of for foo in bar.iter(),
and `for foo in bar.iter_mut(), and for foo in bar.into_iter()
(continuation of #7197)
2015-08-18 01:46:11 +01:00
James Graham
f52276d2cc Use hosts-replaced URL only when loading resources 2015-08-05 10:34:20 +01:00
Sam Gibson
c44579018a Obey Strict-Transport-Security header 2015-08-02 21:17:58 +12:00
Patrick Walton
024c4df912 script: Fix merge fallout. 2015-07-31 11:28:09 -07:00
Patrick Walton
2aa5174246 script: Make the resource task communication use IPC channels. 2015-07-31 11:28:09 -07:00
Patrick Walton
44d13f7fd4 net: Use a thread for each AsyncResponseTarget to avoid having to send
trait objects across process boundaries.
2015-07-31 11:27:49 -07:00
Patrick Walton
9c9d7dc93b net: Make most of the resource task messages serializable. 2015-07-31 11:27:49 -07:00
Sam Gibson
bae979137a Moves HSTS includeSubdomains enum to net_traits 2015-07-22 11:49:09 +12:00
Sam Gibson
82cafc4274 Passes an Arc<Mutex<HSTSList>> to threads instead of cloning 2015-07-22 11:49:09 +12:00
Sam Gibson
11f5be6d85 Responds to more code review feedback
* Use regex from resource task
* Don't have an option of an HSTS list, default to empty
2015-07-22 11:49:08 +12:00
Sam Gibson
f2148f06b1 Moves the HSTS replacement code to http_loader
This respects STS for redirects as well.
2015-07-22 11:49:08 +12:00
Sam Gibson
826f56bdf3 Moves HSTS code to it's own module 2015-07-22 11:49:07 +12:00
Sam Gibson
02bd5cdc1b Resolves remaining code review issues
* Don't pass a boolean to the HSTSEntry constructor, use an enum instead
* Don't clone when securing load data
* Comment about the Url bug
* Change remaining assert!(... == ...) to assert_eq!(..., ...)
2015-07-22 11:49:07 +12:00
Sam Gibson
29a34dbdb5 Resolves code review comments
* Lots of rust-isms
* Mutable iterator for modifying entries (much better)
2015-07-22 11:49:06 +12:00
Sam Gibson
a068a80619 Don't unnecessarily clone strings 2015-07-22 11:49:06 +12:00
Sam Gibson
8a401d5a7f Re-parse URL to not have inconsistent state 2015-07-22 11:49:05 +12:00
Sam Gibson
795454fb81 Adds control message for HSTS headers 2015-07-22 11:49:04 +12:00
Sam Gibson
f284181781 Abstract out ResourceManager messaging from impl
De-coupling makes testing a bit easier.
2015-07-22 11:49:04 +12:00
Sam Gibson
ff1777e446 Evict HSTS entries when a max-age of 0 is seen 2015-07-22 11:49:03 +12:00
Sam Gibson
690ac636eb Rename/refactor 2015-07-22 11:49:03 +12:00
Sam Gibson
15c90a58b2 Expire HSTS entries that have exceeded their max-age
servo/servo#6105
2015-07-22 11:49:03 +12:00
Sam Gibson
8d39fb6dcf Shift checking for IP address host for HSTS entry to constructor
servo/servo#6105
2015-07-22 11:48:05 +12:00
Sam Gibson
cb9b0c2a7a Add max-age to HSTS entries
Refactors API for pushing new entries on, and adds a max age. This does
not add a check for the max-age, or remove old entries from the list.
Instead this just adds the data-field.

servo/servo#6105
2015-07-22 11:48:05 +12:00
Sam Gibson
72d4433587 Do not allow IP address in HSTS list
As per [rfc6797](https://tools.ietf.org/html/rfc6797#section-8.1.1), do
not allow IPv4 or IPv6 addresses as host entries into the HSTS list.

servo/servo#6105
2015-07-22 11:48:04 +12:00
Sam Gibson
d2f35555b9 Implement mutable HSTS list
This prepares the resource task to update the HSTS list when it sees STS
headers. This will allow full HSTS support for servo/servo#6105 when the
resource task implements the header checking
2015-07-22 11:48:03 +12:00