Skip to content
This repository has been archived by the owner on Mar 29, 2023. It is now read-only.

check http status code during WebFile reads and return error for non-2XX #17

Merged
merged 1 commit into from
Apr 22, 2019
Merged

check http status code during WebFile reads and return error for non-2XX #17

merged 1 commit into from
Apr 22, 2019

Conversation

jmank88
Copy link
Contributor

@jmank88 jmank88 commented Apr 22, 2019

This PR adds an HTTP status code check to WebFile.Read so that non-2XX codes return an error. Before this change, the body of an error response would be accepted as the content, so e.g. a user might add a url for an object in a private cloud storage bucket and the cluster/node would silently hash an error message about not having access (this is how I discovered this).

@Stebalien
Copy link
Member

Thanks!

@Stebalien Stebalien merged commit ed2c2b7 into ipfs:master Apr 22, 2019
@jmank88 jmank88 deleted the webfile-err branch April 22, 2019 22:28
hacdias pushed a commit to ipfs/boxo that referenced this pull request Jan 11, 2023
check http status code during WebFile reads and return error for non-2XX

This commit was moved from ipfs/go-ipfs-files@ed2c2b7
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants