Commit graph

141 commits

Author SHA1 Message Date
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
bors-servo
72125f070d Auto merge of #7391 - jdm:prefs, r=Ms2ger
Replace catch-all experimental flag with fine-grained boolean prefere…

…nces initialized from a JSON document.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7391)
<!-- Reviewable:end -->
2015-08-28 10:08:32 -06:00
Josh Matthews
6e26fefad1 Allow setting preferences from the reftest manifest. Add a command-line arg to enable a given preference. 2015-08-28 10:50:55 -04:00
Simon Sapin
95a252a650 Refactor script::textinput to count UTF-8 bytes rather than code points. 2015-08-28 11:57:40 +02:00
David Rajchenbach-Teller
ec9502b0de Resolves #7031 - Fix warnings in ./mach test-ref 2015-08-26 16:37:50 +02: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
bors-servo
4837dd9a1c Auto merge of #6850 - servo:rustup_2015-07-30, r=SimonSapin
Upgrade to rustc 1.3.0-dev (87055a68c 2015-07-30)

This builds and passes unit tests.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6850)
<!-- Reviewable:end -->
2015-07-30 14:46:13 -06:00
Simon Sapin
f10851e788 Update heap size tests for Vec allocation strategy change. 2015-07-30 17:30:53 +02:00
Avi Weinstock
f86252a60b Add set_clipboard_context function and relevant plumbing. Use Option more consistantly (less unwraps) in textinput's selection handling. 2015-07-29 12:19:37 -04: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
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
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
855a9487ae Do not change the port when loading HSTS domain
servo/servo#6105
2015-07-22 11:48:04 +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
Sam Gibson
aa19a9a741 Preload an HSTS domain list from chromium
This resolves the first part of servo/servo#6105. The remaining part is
to update the list based on the STS headers from the server.
2015-07-22 11:48:03 +12:00
Bogdan Cuza
0baa6b477c Replace astersisks with appropriate versions in deps 2015-07-20 20:08:08 +03:00
Simon Sapin
83d2a11d86 Upgrade to rustc 1.3.0-dev (fddfd089b 2015-07-10) 2015-07-15 00:46:43 +02:00
bors-servo
cc73aad447 Auto merge of #6546 - michaelwu:slim-layoutdatawrapper, r=Ms2ger
Remove LayoutChan from LayoutDataWrapper

Saves 32 bytes in Node.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6546)
<!-- Reviewable:end -->
2015-07-05 21:39:12 -06:00
Corey Farwell
3cfd4d14e2 Unit test for util::str::split_html_space_chars
I was concerned for a little bit that passing just whitespace to the
split_html_space_chars function would result in len > 0, so I wrote this
small unit test to make sure it does the right thing. Even though it
does do the right thing, I think there's still value in committing the
unit test.
2015-07-04 18:57:42 -07:00
Michael Wu
1a014beb08 Remove LayoutChan from LayoutDataWrapper 2015-07-04 03:54:40 -04:00
Ms2ger
bf50379833 Enable experimental features in the multiple_stylesheets_cascading test (fixes #6466). 2015-06-26 17:15:20 +02:00
Ms2ger
73a7e92bfd Update to rustc 2d0cbf3e3e25e092bd9e4c94d08e446b680869f0. 2015-06-25 20:02:36 +02:00
ecoal95
8cbfb3482c Use euclid from crates.io 2015-06-19 00:04:24 +02:00
Simon Sapin
0229de822b Use string-cache from crates.io 2015-06-16 00:27:50 +02:00
Corey Farwell
5c408d2be9 rust-geom API changes
https://github.com/servo/rust-geom/pull/81
2015-06-13 12:28:21 -07:00
Nicholas Nethercote
ab59a201f8 Improve unit testing of util::mem. 2015-06-11 15:23:27 -07:00
Manish Goregaokar
7bc88d541f Add unit test for plugin 2015-06-03 07:14:24 +05:30