-
Notifications
You must be signed in to change notification settings - Fork 4
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
fix: various fetch issues #5
fix: various fetch issues #5
Conversation
HTTP method is being set to undefined when a request doesn't provide a method. Check that the property exists before attempting to set it.
Fetch requests can sometimes be passed an entire Request object, handle that scenario.
As per the standard.
Thanks for this @ericlewis I'll take a look |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ericlewis Looks good thank you, I only had one comment.
Would you also be able to let me know what issues you ran into so I can add those to the header and fetch tests?
let headersClass: @convention(block) () -> Headers = { | ||
Headers() | ||
let headersClass: @convention(block) (JSValue?) -> Headers = { headers in | ||
if let headers { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you'll also need to check if the underlying JSValue
is also null
or undefined
here, there's a helper for this. Something like:
if let headers, headers.hasValue {
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry for not seeing this. did you make the change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, all good, thanks again for the contribution!
This tries to bring fetch more in line with specs & fixes some bugs