| Jun | JUL | Aug |
| 24 | ||
| 2020 | 2021 | 2022 |
COLLECTED BY
Collection: Wikipedia Eventstream
|
Incomplete.
I'm not sure how to support Closes #43. |
Test credentials options
68d86d0
dgraham
reviewed
| @@ -196,3 +196,43 @@ promiseTest('supports HTTP DELETE', 2, function() { | |||
| equal(request.data, '') | |||
| }) | |||
| }) | |||
|
|
|||
| promiseTest('doesnt send cookies with implicit omit credentials', 1, function() { | |||
|
We need to default to "omit" in the Request constructor.
I wish the default was |
No contraction
af17642
Default credentials to 'omit'
1bbe6f0
Contributor
Author
|
Any ideas how to disable cookies for |
|
That feature does not exist in XMLHttpRequest. XMLHttpRequest only has same-origin and CORS. I could be convinced to have the standard default to same-origin, but it seems rather ugly to have a different default from cross-origin. (Mistake with how we designed XMLHttpRequest...) |
|
@annevk it seems like the majority of fetch contexts (image, script, style, subresources) mostly use |
|
Well they use include but also set mode to no-cors by default. If you use the crossorigin attribute I think the intent is omit and mode cors, though implementations might do same-origin and mode cors... |
@annevk From my perspective, a default of
A simple
For now, we've added a default of
If you think it's appropriate, maybe the default in the specification could be changed to |
|
I recommend filing a bug against the specification. I don't really like |
Merge branch 'master' into test-cookies
33d47f4
josh
added a commit
that referenced
this pull request
Merge pull request #56 from github/test-cookies
6617c40
Support credentials
6617c40
into
master
test/server.jsin68d86d0
|
did you mean this to be |params.name && params.value|? |
|
heh, yeah |
fetch support
32bdc12
tl;dr - This commit add support for fetch. - pretender swap native fetch related API if exists - pretender.shutdown() restore native fetch related API - doesn't work with AbortController Pretender has been working well with xhr, but doesn't handle fetch. It's been 2 years since @rwjblue first open the [issue](pretenderjs#60) for fetch support. So people don't need to do extra work to polyfill for testing. Include a fetch ponyfill and swap the native fetch during pretender creation, then restore them when `shutdown`. Since fetch polyfill uses xhr behind the scene, pretender will "just work". Per Yetch homepage, the supplement set of yetch impl and spec include: - Inability to [set the redirect mode](github/fetch#137) - Inability to [change the cache directive](github/fetch#438 (comment)) - Inability to [disable same-origin cookies](github/fetch#56 (comment)) - `xhr.abort()` first set state to done, finally response to a [network error](https://xhr.spec.whatwg.org/#the-abort()-method); - [fetch](https://dom.spec.whatwg.org/#aborting-ongoing-activities) will reject promise with a new "AbortError" DOMException. For `fake_xml_http_request` impl, the request is resolved once its state is changed to `DONE` so the `reject` is not cathed. So the senario happens in pretender is: 1. state chagne to `DONE`, trigger resolve request 2. abort, trigger reject 3. xhr.onerror, trigger reject The first resolve wins, error thus not rejected but an empty request is resolved. Though polyfilled by xhr, fetch returns a Promise and is asynchronous by nature.xg-wang added a commit to xg-wang/pretender that referenced this pull request
fetch support
b0986ea
tl;dr - This commit add support for fetch. - pretender swap native fetch related API if exists - pretender.shutdown() restore native fetch related API - doesn't work with AbortController Motivation ------ Pretender has been working well with xhr, but doesn't handle fetch. It's been 2 years since @rwjblue first open the [issue](pretenderjs#60) for fetch support. So people don't need to do extra work to polyfill for testing. Changes ------ Include a fetch ponyfill and swap the native fetch during pretender creation, then restore them when `shutdown`. Since fetch polyfill uses xhr behind the scene, pretender should "just work". Caveats ------ 1. The supplement set of yetch impl and spec includes (not complete): - Inability to [set the redirect mode](github/fetch#137) - Inability to [change the cache directive](github/fetch#438 (comment)) - Inability to [disable same-origin cookies](github/fetch#56 (comment)) 2. Abort - `xhr.abort()` first set state to done, finally response to a [network error](https://xhr.spec.whatwg.org/#the-abort()-method); - [fetch](https://dom.spec.whatwg.org/#aborting-ongoing-activities) will reject promise with a new "AbortError" DOMException. As implemented in `fake_xml_http_request`, the request is resolved once its state is changed to `DONE`. So the senario happens in pretender is: 1). state chagne to `DONE`, trigger resolve request 2). abort, trigger reject 3). xhr.onerror, trigger reject The first resolve wins, error thus not rejected but an empty request is resolved. 3. Though polyfilled by xhr, fetch returns a Promise and is asynchronous by nature.xg-wang added a commit to xg-wang/pretender that referenced this pull request
fetch support
3369d4e
tl;dr - This commit adds support for fetch. - pretender swap native fetch related API if exists - pretender.shutdown() restore native fetch related API - doesn't work with AbortController Motivation ------ Pretender has been working well with xhr, but doesn't handle fetch. It's been 2 years since @rwjblue first open the [issue](pretenderjs#60) for fetch support. So people don't need to do extra work to polyfill for testing. Changes ------ Include a fetch ponyfill and swap the native fetch during pretender creation, then restore them when `shutdown`. Since fetch polyfill uses xhr behind the scene, pretender should "just work". Caveats ------ 1. The supplement set of yetch impl and spec includes (not complete): - Inability to [set the redirect mode](github/fetch#137) - Inability to [change the cache directive](github/fetch#438 (comment)) - Inability to [disable same-origin cookies](github/fetch#56 (comment)) 2. Abort - `xhr.abort()` first set state to done, finally response to a [network error](https://xhr.spec.whatwg.org/#the-abort()-method); - [fetch](https://dom.spec.whatwg.org/#aborting-ongoing-activities) will reject promise with a new "AbortError" DOMException. As implemented in `fake_xml_http_request`, the request is resolved once its state is changed to `DONE`. So the senario happens in pretender is: 1). state changes to `DONE`, trigger resolve request 2). abort, trigger reject 3). xhr.onerror, trigger reject The first resolve wins, error thus not rejected but an empty request is resolved. 3. Though polyfilled by xhr, fetch returns a Promise and is asynchronous by nature.xg-wang added a commit to xg-wang/pretender that referenced this pull request
fetch support
950b49d
tl;dr
- This commit adds support for fetch, fix pretenderjs#60.
- pretender swap native fetch related API if exists
- pretender.shutdown() restore native fetch related API
- doesn't work with AbortController
Changes
------
Include a fetch ponyfill and swap the native fetch during pretender
creation, then restore them when `shutdown`. Since fetch polyfill uses
xhr behind the scene, pretender should "just work".
Caveats
------
1. The supplement set of yetch impl and spec includes (not complete):
- Inability to [set the redirect mode](github/fetch#137)
- Inability to [change the cache directive](github/fetch#438 (comment))
- Inability to [disable same-origin cookies](github/fetch#56 (comment))
2. Abort
- `xhr.abort()` first set state to done, finally response to a
[network error](https://xhr.spec.whatwg.org/#the-abort()-method);
- [fetch](https://dom.spec.whatwg.org/#aborting-ongoing-activities) will
reject promise with a new "AbortError" DOMException.
As implemented in `fake_xml_http_request`, the request is resolved once its
state is changed to `DONE`.
So the scenario happens in pretender is:
1). state changes to `DONE`, trigger resolve request
2). abort, trigger reject
3). xhr.onerror, trigger reject
The first resolve wins, error thus not rejected but an empty request is resolved.
3. Though polyfilled by xhr, fetch returns a Promise and is asynchronous by
nature.
Initial commit
e51904c
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
No reviews
No one assigned
Labels
None yet
No milestone
Successfully merging this pull request may close these issues.
4 participants Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. ●© 2021 GitHub, Inc. ●Terms ●Privacy ●Security ●Status ●Docs ●Contact GitHub ●Pricing ●API ●Training ●Blog ●About You can’t perform that action at this time. You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.