Commit graph

80 commits

Author SHA1 Message Date
Dowon Cha
8bf924dc79 Added Websocket to RequestMode enum
set unreachable in dom/request.rs for websocket

fixed imports
2017-01-08 09:17:53 -05:00
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
Matt McCoy
ed075ab552 Reuse the http connector pool between fetches 2016-12-26 19:39:11 -05:00
Keith Yeung
63a7e8efdf Add domain and path checks for secure cookies eviction 2016-12-21 03:39:38 -08:00
bors-servo
bde8dce756 Auto merge of #14526 - frewsxcv:cookies, r=jdm
Attempt at refactoring and simplifying 'set cookies' operations on resource thread.

<!-- 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/14526)
<!-- Reviewable:end -->
2016-12-15 15:54:39 -08:00
Corey Farwell
77d2f9de36 Refactor and simplify 'set cookies' operations on resource thread. 2016-12-15 15:34:04 -05:00
Ms2ger
217f44b67a Make the fetch target non-optional. 2016-12-15 10:49:04 +01:00
Alan Jeffrey
9be4fd56ce Removed util. 2016-12-14 18:04:37 -06:00
Ms2ger
cd40bb54ae Remove ProgressSender. 2016-12-13 17:15:12 +01:00
Ms2ger
1f9d7ddf4d Remove unused send_error, start_sending_sniffed_opt. 2016-12-13 17:14:53 +01: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
69f856486a Remove unused CancellableResource and CancellationListener types. 2016-11-24 11:46:32 +01:00
Ms2ger
7913f3adaf Remove the unused CancellationListener arguments in filemanager_thread. 2016-11-24 11:46:30 +01:00
Ms2ger
fb1279ec3a Remove CoreResourceMsg::Load.
Also remove now-dead code that rustc warns about.

It turns out that we lost support for some of our custom URL schemes; I intend
to reimplement them, but I believe this will be significantly easier to do
once the legacy code is out of the way.
2016-11-24 11:46:24 +01:00
Ms2ger
15e8f4f0d4 Properly exit the core resource thread. 2016-11-24 11:46:22 +01:00
Ms2ger
ae1340bf50 Pass the UIProvider to FileManager::handle() as needed. 2016-11-21 10:37:26 +01:00
Emilio Cobos Álvarez
913c874cb5
Urlmageddon: Use refcounted urls more often. 2016-11-17 18:34:23 +01:00
Ms2ger
234b47e33e Pass a borrowed fetch context to fetch().
This will allow inspecting its state after fetching in unit tests.
2016-11-08 18:01:23 +01:00
Ms2ger
fe3d512ea4 Remove ProgressSender::Listener. 2016-11-02 16:15:23 +01:00
Ms2ger
8a6016013e Remove unused argument to start_sending_opt. 2016-11-02 16:15:22 +01:00
Ms2ger
40c711bf97 Remove LoadConsumer::Listener. 2016-11-02 16:15:21 +01:00
Ms2ger
fc68e0a6ca Add a FileManager to FetchContext. 2016-10-14 11:30:09 +02:00
Ms2ger
d820387758 Stop wrapping FileManager in an Arc.
It already contains an Arc internally.
2016-10-14 11:30:08 +02:00
Corey Farwell
60afad1b61 Migrate user agent string to Cow<'static, str>.
In most scenarios, where the user of Servo will not override the default
user agent, the user agent can be a `&'static str`. But since we allow
for customization, we currently use a `String` to represent the user
agent. This commit migrates the user agent to be represented as a
`Cow<'static, str>`, which (at the cost of ergonomics) prevents
unnecessary allocations whenever cloning the user agent string in the
scenario the user doesn't override the user agent.
2016-10-10 16:34:20 -04:00
bors-servo
b1d8eff467 Auto merge of #13411 - frewsxcv:mime, r=jdm
Migrate mime_classifier top-level string to enum.

I made this branch months ago and forgot about it. Instead of just throwing the changes away, I rebased off origin/master and opened this pull request. If these changes aren't desired, no feelings hurt, just close this. If they are desired, let me know if there are any changes you want me to make and I'll also need to rewrite/squash the commits.

<!-- 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/13411)
<!-- Reviewable:end -->
2016-10-08 15:40:47 -05:00
Corey Farwell
349e01f6eb Fix capitalization for enum variants. 2016-10-08 15:48:18 -04:00
Corey Farwell
66303e40b5 Migrate mime_classifier top-level string to enum. 2016-10-08 15:41:58 -04:00
Bryan Gilbert
82e45a403f updated basic auth cache to key off of url origin 2016-09-15 22:08:52 -04:00
UK992
93a103ba73 Reorder use statements 2016-09-09 04:55:19 +02:00
Anthony Ramine
7ad51dcd7a Update serde to 0.8 (fixes #12659) 2016-08-12 18:37:27 +02:00
Zhen Zhang
17ae38a318 Add cancellability to file manager load and related refactoring 2016-08-02 23:51:51 +02:00
ddh
db808ca75d Added devtools support to fetch for XHR + Manish's XHR ident fix
added unit test for request fetch with devtools

added devtools/fetch test
2016-07-29 11:20:38 +01:00
Anthony Ramine
8d919c5c1f Remove use of util::opts from storage_thread 2016-07-27 10:25:48 +02:00
Anthony Ramine
1662e292d8 Remove use of util::opts from resource_thread 2016-07-27 10:22:06 +02:00
Rahul Sharma
eff3e01df0 make resource_thread talk to sw-manager 2016-07-18 19:06:48 +05:30
Rahul Sharma
1e6293ea1d Integrate service worker manager thread 2016-07-16 23:29:44 +05:30
Aneesh Agrawal
cc2b2a85bd Remove fn start_sending_sniffed
This function was not used, but more importantly encodes the bad
practice of a raw `.unwrap()` and therefore should not be used.
2016-07-15 11:03:49 -04:00
Zhen Zhang
fdc3a8e3ac Put Blob URL online 2016-07-15 20:33:51 +08:00
bors-servo
194fb3e199 Auto merge of #12190 - frewsxcv:mime-renaming, r=jdm
Minor MIME renaming and aliasing cleanup.

<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/12190)
<!-- Reviewable:end -->
2016-07-03 11:07:12 -07:00
Corey Farwell
6c02a576cf Rename MIMEClassifier to match Rust acronym naming conventions.
e.g. `std::net::TcpStream`
2016-07-02 17:12:46 -04:00
Corey Farwell
22928f50ac Refactor util::prefs operations to be methods on static struct. 2016-07-02 16:43:39 -04:00
Josh Matthews
94df389031 Print out useful SSL-related information on SSL error page. 2016-06-29 14:21:12 -04:00
Dan Robertson
246723114f
Use common cookie struct add cookie webdriver cmds
One cookie struct to rule them all. One struct to represent them.
One cookie struct to bind them all, and through the IPC carry them.
2016-06-25 22:24:35 +00:00
Sagar Muchhal
7e2b4d163b Propagate privacy information of iframes to corresponding pipelines. Make iframes of differing privacy values be considered cross-origin.
Make the constellation hand out separate private and public channels for the pipeline content to communicate with the resource thread as necessary.
2016-06-20 14:55:01 -04:00
Zhen Zhang
256c7e894e filepicker 2016-06-14 20:22:51 +08:00
Manish Goregaokar
fd6f9bd411 Test fixes; update for changes in spec 2016-06-10 20:55:25 +05:30
Manish Goregaokar
bf99e73cb0 Re-add support for fetching chunks (and thus xhr download progress) 2016-06-10 20:53:40 +05:30
Manish Goregaokar
6e29b872d7 Test fixes:
- Hack to stop hitting unreachable on referer
 - add fetch_done to make sync work
 - Make datauris work by setting the response URI, spec bug
 - Allow for empty bodies
 - Make request bodies work (pass to http, fix fencepost in iter count)
2016-06-10 20:53:36 +05:30
Manish Goregaokar
8bcf54deb5 Use RequestInit instead of LoadData. Make code look like the spec. 2016-06-10 20:53:28 +05:30