-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect Request implementation #177
Comments
Are you using fetch v0.8 or greater? ab1ac93 |
Yeah, I'm on v0.9. The problem is caused because when you create a new Request from an existing request, it's always setting the first param as the url. The spec for the Request class' first param is RequestInfo, and the typedef says it can be a USVString or a Request. var r = new Request('/foo')
console.log(r.url)
var f = new Request(r)
console.log(f.url)
fetch(f) If you try out the code above, in Safari it'll fetch |
Ah, I see now. You're passing a Request to a Request constructor. I don't think we support that case yet. Thanks for reporting. |
@mislav could we get a new release of whatwg-fetch :D? |
Operating system: OS X Yosemite Version 10.10.4
Browser: Safari Version 8.0.7 (10600.7.12)
I've been developing with the following browsers:
Both Firefox and Chrome implement the expected behavior.
Code sample:
The implementation in this repository is always taking the first parameter and setting it as the URL, but this is inconsistent with the standard, which allows you to pass a Request instance as the first parameter.
In the short-term, please consider adding a note to the README to inform users of this inconsistency. Tracking down this issue in Safari proved to be quite tricky for my project.
The text was updated successfully, but these errors were encountered: