Commit graph

212 commits

Author SHA1 Message Date
faineance
418842faf9 use self.0 instead of destructing single item tuple structs 2016-03-27 11:50:08 +01:00
Stjepan Glavina
4965c93d16 Merge branch 'master' into fix-local-urls-only-10147 2016-03-24 13:45:25 +01:00
Stjepan Glavina
3ec4515a73 Address PR comments
- Remove fn `url_is_local`
- Remove fn `set_local_urls_only`
- Fix `test_fetch_with_local_urls_only`
2016-03-24 13:42:40 +01:00
Stjepan Glavina
bcd813d961 Fix fetching about:blank
When fetching about:blank, response body should be the empty byte
sequence.
Spec: https://fetch.spec.whatwg.org/#concept-basic-fetch

Before this change, response body would be set to `ResponseBody::Empty`,
and then fetching would result in an infinite loop at step 19 in fn
`main_fetch` (methods.rs).
2016-03-24 11:17:12 +01:00
Stjepan Glavina
6576fde29b Correctly handle flag local_urls_only
In function Request::fetch_main, flag local_urls_only (if set)
should allow fetching local urls only. Before this change, the flag had
the inverse behaviour.
2016-03-23 18:01:43 +01:00
Ms2ger
91d63d5fcf Use a match rather than unwrap() in main_fetch. 2016-03-10 14:07:41 +01:00
Ms2ger
3e3053653e Fix warnings in the fetch code. 2016-03-09 16:12:15 +01:00
Ms2ger
8b629652ac Make Response::new() an inherent method.
There is no real reason to put this in an extension trait.
2016-03-08 17:55:18 +01:00
bors-servo
fee7cb179e Auto merge of #9850 - nikkisquared:2_async_2_furious, r=jdm
Set response.body Asynchronously In Fetch

Following having finished making Fetch asynchronous, response.body should be set asynchronously, since it's the major goal of calling Fetch. So far, I've made the body wrapped in Arc<Mutex<>>, and I've wrapped a new thread around the part where it's set. I've also discovered that the fetch_async function makes step 8 of Main Fetch obsolete, and I've commented it appropriately.

I'm currently having a hard time with the thread for setting response.body, though. @jdm suggested I have the body set continually, block by block, but my implementation for that runs so slow that I can't finish running my fetch test suite in reasonable time. @KiChjang pointed out that a lot of the lag is due to how response.body currently stores everything inside a Vec. Changing the storage container seems to be both necessary and beyond the scope of the time I have to work on this.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9850)
<!-- Reviewable:end -->
2016-03-08 04:45:25 +05:30
Nikki
b187985e49 set response.body asynchronously in Fetch 2016-03-07 15:09:39 -07:00
Anthony Ramine
7c1dd54895 Update to Rust 2016-03-05 2016-03-06 10:36:49 +01:00
Nikki
3f79667050 implementing working demonstration of calling Fetch asynchronously 2016-03-01 13:02:38 -07:00
Keith Yeung
96971244ac Update fetch attributes to match the new spec 2016-02-27 08:40:09 -05:00
Nikki
cf607606e0 implement http redirect fetch, and various Fetch Standard updates 2016-02-17 12:52:24 -07:00
Nikki
e8665d47ea working on implementing Cors Check and Origin to Ascii serialisation 2016-02-09 13:51:35 -07:00
Nikki
db8cc6eccf Partial implementation of Main Fetch step, including appropiate updates to tests 2016-01-29 12:40:54 -07:00
Nikki
5426df32de tests for boundary conditions on redirect_count in fetch 2016-01-20 13:03:08 -07:00
Nikki
4165786767 Test setting response.body by fetching on a server 2016-01-18 15:12:31 -07:00
Keith Yeung
a53661f6c8 Rename net/fetch/request.rs to net/fetch/methods.rs and move Request to net_traits 2016-01-18 00:57:19 -05:00
Nikki
5a8c533755 Implement a basic test for Fetch and fix errors it finds 2016-01-13 16:45:57 -07:00
rohan.prinja
1f02c4ebbb task -> thread 2016-01-10 17:58:13 +09:00
Nikki
c5982872c8 rewrapped Rc<RefCell<Response>> into Rc<Response> 2016-01-08 12:17:13 -07:00
Nikki
67f4df5d3a changed Rc<RefCell<Request>> into Rc<Request> 2016-01-07 12:16:01 -07:00
Keith Yeung
05dc512055 Extract Response from net_traits/lib.rs 2016-01-06 09:45:22 -05:00
Nikki
af310f7874 minimal implementation of http_network_fetch for testing purposes 2016-01-05 12:14:07 -07:00
Nikki
d30998c4a6 Partial implementation of HTTP-network-or-cache fetch step. 2015-12-29 16:37:11 -05:00
Mathieu Agopian
11234f5370 Use Url.join instead of UrlParser.base_url(...).parse (#9002) 2015-12-18 17:02:41 +01:00
Keith Yeung
7d3eb72a26 Refactor http_fetch to reflect the new standard 2015-11-26 17:12:19 -08:00
Corey Farwell
e3aabd0bc5 DRY out conditional logic in CORS header matching 2015-10-11 20:55:01 -04:00
Corey Farwell
81e034885b Cleanup code that was warned by rust-clippy 2015-10-11 20:47:45 -04:00
Keith Yeung
ecf02a3656 Initial fetch refactor 2015-09-28 12:24:15 -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
Johann Tuffe
ec07178b6f sort all uses 2015-08-20 20:47:12 +08:00
Josh Matthews
8bb853f643 Fix existing syntactics nits. 2015-08-16 10:30:43 -04:00
Simon Sapin
83d2a11d86 Upgrade to rustc 1.3.0-dev (fddfd089b 2015-07-10) 2015-07-15 00:46:43 +02:00
Ms2ger
b49bd79625 Use str::parse() rather than FromStr::from_str.
The former appears to be preferred.
2015-06-13 17:58:16 +02:00
Corey Farwell
435e551753 Remove get_ prefix on getters
Part of #6224

I certainly didn't remove all of them; I avoided `unsafe` areas and also `components/script`
2015-06-02 08:54:44 -04:00
Corey Farwell
8e3f4bba85 Reduce max line length from 150 to 120 characters
Part of https://github.com/servo/servo/issues/6041
2015-05-24 00:01:49 -04:00
bors-servo
79ed6250f0 Auto merge of #6129 - KiChjang:fetch-spec, r=jdm
<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6129)
<!-- Reviewable:end -->
2015-05-19 23:08:41 -05:00
Keith Yeung
3351ddf213 Implement fetch (partial #4576) 2015-05-19 23:35:27 -04:00
Ms2ger
fa4fe01757 Use snake case in fetch. 2015-05-19 17:41:31 +02:00
Ms2ger
4ca6325bad Remove an unwrap() call in HTTP fetch. 2015-05-19 17:38:56 +02:00
Keith Yeung
450931a171 Implemented http fetch (partial #4576) 2015-05-18 10:23:28 -04:00
Simon Sapin
ef8edd4e87 Upgrade to rustc 551a74dddd84cf01440ee84148ebd18bc68bd7c8. 2015-05-05 10:07:34 -04:00
Ms2ger
903305416a Implement Clone for Copy types. 2015-04-28 23:31:10 +02:00
Corey Farwell
5eaa922045 Update WHATWG links to use HTTPS
Extracted this out of #5649

This commit was created with the following commands:

```
find . -iname "*.webidl" -type f -print0 | xargs -0 sed -i '' 's/http:\(.*\)whatwg.org/https:\1whatwg.org/g'
```

```
find . -iname "*.rs" -type f -print0 | xargs -0 sed -i '' 's/http:\(.*\)whatwg.org/https:\1whatwg.org/g'
```
2015-04-13 21:34:27 -07:00
Josh Matthews
1757afef27 Remove int_uint from net. 2015-04-07 16:13:37 -04:00
Ms2ger
ba87666cdb Update some code that's feature-gated under core. 2015-03-21 18:44:39 +01:00
Simon Sapin
d5dd1d658e Upgrade to rustc ba2f13ef0 2015-02-04 2015-02-11 14:48:34 -08:00