Commit graph

35 commits

Author SHA1 Message Date
Ms2ger
b46846e2a0 Rustfmt net_traits. 2017-01-03 15:06:41 +01:00
Ms2ger
1222db62aa Remove Request::done.
It does not appear to be used at all.
2016-12-09 12:36:46 -10:00
Ms2ger
12aa4694cb Rewrite determine_request_referrer() to explicitly limit it to the checks it can do.
Checks for the Client value should reside in the script thread.

I also noted some other issues in this code.
2016-12-08 12:05:44 -10:00
Emilio Cobos Álvarez
913c874cb5
Urlmageddon: Use refcounted urls more often. 2016-11-17 18:34:23 +01:00
Keith Yeung
d99d26cf1f Implement the constructor for EventSource 2016-11-11 14:50:37 -08:00
bors-servo
e3f07dfa16 Auto merge of #14156 - frewsxcv:cors-capitalization, r=KiChjang
Update CORS naming from 'CORS' to 'Cors'.

As per:

https://aturon.github.io/style/naming/README.html#general-conventions-[rfc-#430]

Acronyms should be considered one word and not all caps.

<!-- 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/14156)
<!-- Reviewable:end -->
2016-11-10 14:43:36 -06:00
Corey Farwell
bf8752ac9e Update CORS naming from 'CORS' to 'Cors'.
As per:

https://aturon.github.io/style/naming/README.html#general-conventions-[rfc-#430]

Acronyms should be considered one word and not all caps.
2016-11-09 18:30:30 -05:00
Raphael Nestler
3cc9f46ce5 Set redirect_mode in Request::from_init() 2016-11-08 18:20:47 +01:00
Raphael Nestler
d25b720c06 Add redirect_mode to RequestInit 2016-11-08 18:20:34 +01:00
Ms2ger
277c6d0154 Move ReferrerPolicy to net_traits. 2016-11-04 10:43:37 +01:00
Corey Farwell
c715cef4c5 Remove unused trait method. 2016-10-10 13:42:16 -04:00
Anthony Ramine
b6bbd41e11 Remove GlobalRoot and GlobalRef 2016-10-06 21:36:00 +02:00
Jan Zerebecki
95a7482d26 Remove same-origin-data-url flag from fetch implementation
The spec removed it. Check the scheme instead, data is always same origin now,
except for workers.
This also updates the comments to make step numbers match the spec.
Closes #13362
2016-10-01 00:27:03 -07:00
Keith Yeung
2bb95989c5 Implement default values for RequestInit 2016-09-21 11:50:53 -07:00
Nicolas
924136ee0c Fix most typoes for: "referer" -> "referrer" 2016-09-16 12:40:17 -04:00
bors-servo
78160bf3f9 Auto merge of #12700 - jeenalee:jeena-requestAPI, r=jdm
Implement the Request API

<!-- Please describe your changes on the following line: -->
This PR implements the [Request API](https://fetch.spec.whatwg.org/#request-class) for the Fetch API, including its attributes and constructor, and introduces changes in relevant files.

This Request integrates `net_traits::request::Request` and `dom::headers`.

There are few related TODOs and comments:
1. `net_traits::request::Request`'s `headers` field does not point to `dom::request::Request`'s `headers_reflector`.
2. Every Constructor step that involves `Readable Stream` object is not implemented.
3. Every Constructor step that involves `entry settings object` or `environment settings object` is not implemented.
4. `./mach build -d` does not report any error, but prints a few warnings about unused variables related to (1) and (2).
5. Enum `ReferrerPolicy` generated by `RequestBinding` does not match `net_traits::request::Request`'s implementation.
6. `Promise`s in Body webidl are commented out.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #11895 (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] These changes do not require tests  because tests for the Request API already exists, but this commit does not implement the interface fully.

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- 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/12700)
<!-- Reviewable:end -->
2016-08-12 23:54:49 -05:00
Jeena Lee
fabe2b8f7e Implement the Request API for the Fetch API.
This commit adds new files related to implementing the [Request
API](https://fetch.spec.whatwg.org/#request-class). This commit also
changes the expected web platform tests results. It also modifies the
following files:

components/net_traits/request.rs
HeapSizeOf is implemented in net_traits/request so that dom::request can
be used as a wrapper around net_traits::request::Request.

components/script/dom/headers.rs
Several methods are added to Headers so that request can access and
modify some of the headers fields.
2016-08-12 15:39:40 -07:00
Anthony Ramine
7ad51dcd7a Update serde to 0.8 (fixes #12659) 2016-08-12 18:37:27 +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
Manish Goregaokar
9deecd793c
Review fixes 2016-06-11 11:49:40 +05:30
Manish Goregaokar
fd6f9bd411 Test fixes; update for changes in spec 2016-06-10 20:55:25 +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
Manish Goregaokar
2cbc8dee25 Net side of XHR fetch integration 2016-06-10 20:53:15 +05:30
Manish Goregaokar
b5255f011e Revamp Fetch async handling to use a fetch target and done channels 2016-06-10 20:53:10 +05:30
Daniel Robertson
153059c55c
Fix logic for cors cache match
The current logic for a cors cache match does not consider "credentials
is false and request's credentials mode is not "include" or credentials
is true."
2016-04-27 16:39:57 -04:00
Simon Sapin
7932ab6ac2 Upgrade to rust-url 1.0 and hyper 0.9 2016-04-23 20:27:58 +02: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
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
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
Keith Yeung
66c2f6d58b Implement "potential CORS request" 2016-02-03 14:41:36 -05:00
Nikki
db8cc6eccf Partial implementation of Main Fetch step, including appropiate updates to tests 2016-01-29 12:40:54 -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