Commit graph

23 commits

Author SHA1 Message Date
Anthony Ramine
697b9e2b87 Merge net and net_tests 2018-01-20 15:36:09 +01:00
Josh Matthews
6f590a87bf Move hosts module into net crate. Remove obsolete functions. 2017-04-06 19:25:47 +09:00
Anthony Ramine
170bcfc03e Kill hsts::secure_url 2017-04-05 14:42:49 +02: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
UK992
93a103ba73 Reorder use statements 2016-09-09 04:55:19 +02:00
Simon Sapin
7932ab6ac2 Upgrade to rust-url 1.0 and hyper 0.9 2016-04-23 20:27:58 +02:00
Corey Farwell
08fc002f41 Rename 'HSTS*' structures to 'Hsts*'.
"In CamelCase, acronyms count as one word: use Uuid rather than UUID."

-- https://doc.rust-lang.org/style/style/naming/README.html
2016-04-17 14:12:28 -04:00
Corey Farwell
faa3d8724b Refactor Servo HSTS file loading, hard-fail if can't load.
Use constructor pattern instead of separate utility function.

Instead of allowing the Servo HSTS file loading to silently fail, we
should expect that file to always exist and be formatted correctly.
2016-04-17 14:12:07 -04:00
Corey Farwell
d3b8b6472b Move UTF8 bytes handling into generic constructor.
Separate from Servo specific logic.
2016-04-17 12:39:50 -04:00
Corey Farwell
52b3226d54 Rename constructor to match convention, add doc comment. 2016-04-17 12:38:29 -04:00
Simon Sapin
6889f37d9e Remove the url! plugin.
In rust-url 1.0 the `Url` struct is going to have private fields, and there
is no way to to create an aribitrary one without going through the parser.

The plugin never had a clear demonstrated performance benefit,
it was made mostly because it was possible and relatively easy at the time.
2016-04-14 15:35:28 +02:00
Corey Farwell
f34da4120d Implement 'url!(..)' macro
https://github.com/servo/rust-url/issues/136

https://github.com/servo/rust-url/pull/137
2015-11-21 08:15:56 -05:00
Sam Gibson
6f573d5d44 Move HSTS/CookieStorage to Arc<RwLock> from Ipc
servo/servo#7421
2015-09-19 18:30:37 +12: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
Patrick Walton
024c4df912 script: Fix merge fallout. 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
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