Commit graph

90 commits

Author SHA1 Message Date
Prabhjyot Singh Sodhi
920bb5e4b8 tests for devtools integration with network requests/responses 2015-09-25 22:07:01 +05:30
Manish Goregaokar
3c969b346a Upgrade rust to f93ab64d4a1a7ee91759a1594ab2a426b6cc657e/rustc-1.5.0-dev. 2015-09-23 14:44:59 +02:00
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
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
cc44448b09 Fix BinaryOrPLaintextClassifier bug with utf16-be & utf16-le and correct tests 2015-09-12 19:59:20 -04:00
Mathieu Rheaume
68a088bef6 Fixed apache bug flag on not passing the good params 2015-09-12 17:44:16 -04:00
Mathieu Rheaume
ff608de781 fixup! Issue #7382 Use descriptive enums instead of booleans for MIMEClassifier::classifer 2015-09-12 17:44:16 -04:00
Mathieu Rheaume
8525495265 Issue #7382 Use descriptive enums instead of booleans for MIMEClassifier::classifer 2015-09-12 17:44:14 -04:00
Simon Sapin
40b4348824 Upgrade to rustc 1.4.0-dev (cb9323ec0 2015-09-01) 2015-09-02 09:22:17 +02:00
bors-servo
9f85370885 Auto merge of #7449 - simartin:issue_7393, r=metajack
Issue #7393: Properly sniff mislabeled feeds.

Hi,

This patch is an attempt to fix https://github.com/servo/servo/issues/7393, where the code detecting mislabeled feeds (see https://mimesniff.spec.whatwg.org/#sniffing-a-mislabeled-feed) had spurious space in the URLs we need to match.

Note that my testing (in particular rdf_rss_ko_2.xml) highlighted a flaw in "matches", that failed to check that there were more bytes in the string being checked than in the string we're checking against, which completely broke the whole step 5.2.7.

Thanks in advance for your review.

Cheers,
  Simon

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7449)
<!-- Reviewable:end -->
2015-09-01 11:22:52 -06:00
wilmoz
64ac4f175f Make test-tidy check that braces have spaces before or after them 2015-08-31 12:30:55 -05:00
Simon Martin
5301e59965 Issue #7393: Properly sniff mislabeled feeds. 2015-08-30 13:03:20 +02:00
Sam Gibson
f257b5fcef Adds content-length to empty-bodied non-GET/HEAD requests 2015-08-30 12:14:15 +10:00
Sam Gibson
976dbc5155 Adds a test for non-default accept-encoding headers 2015-08-30 12:14:15 +10:00
Sam Gibson
9b1f2231cb Adds a test for non-default accept headers 2015-08-30 12:14:15 +10:00
Sam Gibson
287dc7371f Extracts some dense code to a let binding 2015-08-30 12:14:14 +10:00
Sam Gibson
86df1d3d6a Renames AssertMustHaveHeadersRequest 2015-08-30 12:14:14 +10:00
Sam Gibson
ac0e4b4337 Renames RequestType 2015-08-30 12:14:13 +10:00
Sam Gibson
94284fc47f Fixes new tidy problems 2015-08-30 12:14:09 +10:00
Sam Gibson
d53af0d9ed Fixes merge errors 2015-08-30 12:14:08 +10:00
Sam Gibson
04b7ce0afa Tests rewriting redirects of POST as GET 2015-08-30 12:14:06 +10:00
Sam Gibson
2eaac7e3f9 Adds tests for gzip/deflate response decoding 2015-08-30 12:14:05 +10:00
Sam Gibson
6064ee8756 Eliminates need to box response reader
I don't know how idiomatic this is for rust, but the only way I could think of to do this is with a union enum and generics. As the number of decoders should never be more than a few, this shouldn't really be a problem.
2015-08-30 12:14:05 +10:00
Sam Gibson
879b058be2 Returns LoadResponse struct instead of a tuple
Still boxes the reader, but at least is a step in the right direction
2015-08-30 12:14:05 +10:00
Sam Gibson
3c756d254b Avoids sending a request body on a redirect 2015-08-30 12:14:04 +10:00
Sam Gibson
15d82091c5 Fixes tidy overlong lines 2015-08-30 12:14:04 +10:00
Sam Gibson
5a60fdf4ca Moves STS update code to a function 2015-08-30 12:14:02 +10: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
Sam Gibson
ffc3877deb Adds tests for setting/getting cookies from load 2015-08-30 12:13:35 +10:00
Sam Gibson
26a6e058e7 Adds more tests for checking request headers 2015-08-30 12:13:34 +10:00
Sam Gibson
7a09c2d924 Shifts to a series of traits/associated types instead of having a requester 2015-08-30 12:13:34 +10:00
Sam Gibson
06f09f6cdb Adds tests for redirecting
servo/servo#6727
2015-08-30 12:13:34 +10:00
Sam Gibson
81fe5938bf Removes HttpRequest, adds HttpResponse wrapper
The HttpRequest trait doesn't make sense, on further reflection. Rather,
just modify the method signature on the requester. The hyper request was
only being used to mutate it's headers anyway.

servo/servo#6727
2015-08-30 12:13:33 +10:00
Sam Gibson
7633cd54c2 Abstract everything but the response from hyper
Because we're using unsized types not for requesting, there's not a
satisfactory way of doing this without boxing the request...

Once unsized stuff lands in rust 1.2/1.3(???) then this should be
implemented with Rc's instead of Box's.

For the time being I'm not sure what else to do.

servo/servo#6727
2015-08-30 12:13:33 +10:00
Sam Gibson
6cba33a50b Abstracts the hyper connection to a servo HttpRequester trait
servo/servo#6727
2015-08-30 12:13:32 +10:00
Sam Gibson
67aa11323b Adds simple POC unit test for load
servo/servo#6727
2015-08-30 12:13:32 +10:00
Johann Tuffe
ec07178b6f sort all uses 2015-08-20 20:47:12 +08:00
bors-servo
f340900c38 Auto merge of #7246 - glennw:platform-ua, r=larsbergstrom
Add a simple method to emulate a platform UA (e.g. pretend a desktop build is an android UA).



<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7246)
<!-- Reviewable:end -->
2015-08-17 22:44:38 -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
1e20447746 replace len() !=0 with !is_empty() 2015-08-17 02:56:07 +01:00
Josh Matthews
8bb853f643 Fix existing syntactics nits. 2015-08-16 10:30:43 -04:00
James Graham
f52276d2cc Use hosts-replaced URL only when loading resources 2015-08-05 10:34:20 +01: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
Michael Howell
1339b8ce65 Add basic unit test for preload_hsts_domains.
Closes #6789.
2015-07-27 10:24:38 -07:00
Sam Gibson
bae979137a Moves HSTS includeSubdomains enum to net_traits 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