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

edge gateway does not proxy query parameters to some of the resolution layers #133

Closed
vasco-santos opened this issue Dec 20, 2022 · 0 comments · Fixed by #138 or #139
Closed

edge gateway does not proxy query parameters to some of the resolution layers #133

vasco-santos opened this issue Dec 20, 2022 · 0 comments · Fixed by #138 or #139
Assignees
Labels
kind/bug A bug in existing code (including security flaws) potential/support-pi

Comments

@vasco-santos
Copy link
Contributor

https://github.com/web3-storage/reads/blob/main/packages/edge-gateway/src/gateway.js#L102

IPFS Gateway might have request parameters, like format=car. In 1st layer resolution - CDN we just proxy the request object, and consequently query parameters will be sent. However, other resolution layers are lacking passing the query parameters.

getFromDotstorage and getFromGatewayRacer only pass CID, pathname and headers, which means that for an URL like

const urlString = 'https://bafy.ipfs.w3slink.link/path/to/file?format=car'
const url = new URL(urlString)

pathname will include path/to/file, but we drop query parameters that will result in not getting appropriate response from other parties. We need to proxy also search params from URL

@vasco-santos vasco-santos added kind/bug A bug in existing code (including security flaws) potential/support-pi labels Dec 20, 2022
@jsdevel jsdevel self-assigned this Dec 20, 2022
vasco-santos pushed a commit that referenced this issue Feb 10, 2023
🤖 I have created a release *beep* *boop*
---


##
[1.4.1](ipfs-gateway-race-v1.4.0...ipfs-gateway-race-v1.4.1)
(2023-02-07)


### Bug Fixes

* proxying request query search (fixes
[#133](#133))
([#137](#137))
([9f8c477](9f8c477))

---
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: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
vasco-santos pushed a commit that referenced this issue Mar 3, 2023
🤖 I have created a release *beep* *boop*
---


##
[1.9.1](edge-gateway-v1.9.0...edge-gateway-v1.9.1)
(2023-02-07)


### Bug Fixes

* proxying request query search (fixes
[#133](#133))
([#137](#137))
([9f8c477](9f8c477))

---
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: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment