Skip to content
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: bind globalThis.fetch to globalThis #1242

Merged
merged 2 commits into from
Dec 13, 2023
Merged

Conversation

gobengo
Copy link
Contributor

@gobengo gobengo commented Dec 13, 2023

This makes the assigned fetch behave a bit differently than a regular globalThis.fetch. a globalThis.fetch will sometimes fail if you do const me = { fetch }; await me.fetch(url) but now this bound one won't and will instead behave differently than globalThis.fetch.

I think the difference in behavior doesn't matter too much because we just use the assigned fetch right away without passing it along or calling it in such a way that we'd change the default behavior of function calling where this is globalThis in a way that all fetch i've encountered can work with.

@gobengo gobengo marked this pull request as ready for review December 13, 2023 20:47
@gobengo gobengo changed the title bind globalThis.fetch to globalThis fix: bind globalThis.fetch to globalThis Dec 13, 2023
@gobengo gobengo merged commit ef59358 into main Dec 13, 2023
4 of 5 checks passed
@gobengo gobengo deleted the fix-fetch-bind-1702499405 branch December 13, 2023 20:56
travis added a commit that referenced this pull request Jan 3, 2024
🤖 I have created a release *beep* *boop*
---


##
[13.0.0](upload-client-v12.3.2...upload-client-v13.0.0)
(2023-12-14)


### ⚠ BREAKING CHANGES

* return allocated bytes in `store/add` receipt
([#1213](#1213))

### Features

* dont use ipfs-utils fetch with upload progress by default
([#1240](#1240))
([86aedbc](86aedbc))
* return allocated bytes in `store/add` receipt
([#1213](#1213))
([5d52e44](5d52e44))


### Fixes

* bind globalThis.fetch to globalThis
([#1242](#1242))
([ef59358](ef59358))
* point `main` at files included in the package
([#1241](#1241))
([c0b306d](c0b306d))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: Travis Vachon <travis.vachon@protocol.ai>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant