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

HTTP protocol doesn't follow redirect #121

Closed
nsmith- opened this issue Oct 2, 2020 · 2 comments · Fixed by #201
Closed

HTTP protocol doesn't follow redirect #121

nsmith- opened this issue Oct 2, 2020 · 2 comments · Fixed by #201
Labels
feature New feature or request

Comments

@nsmith-
Copy link
Member

nsmith- commented Oct 2, 2020

I cannot open

uproot4.open("https://github.com/CoffeaTeam/coffea/raw/master/tests/samples/nano_dy.root")

yet I can open the place it 302 redirects to:

uproot4.open("https://raw.githubusercontent.com/CoffeaTeam/coffea/master/tests/samples/nano_dy.root")
@jpivarski
Copy link
Member

Adding my comment from Slack, for the record:

This is a missed case:

https://github.com/scikit-hep/uproot4/blob/d8a4b7203952bb7bd85cbf6d2ed481d610c83e67/uproot4/source/http.py#L163-L174

doesn't check for response.status == 302 (redirect) and use the connection to try again at response.headers["location"].

Same for:

https://github.com/scikit-hep/uproot4/blob/d8a4b7203952bb7bd85cbf6d2ed481d610c83e67/uproot4/source/http.py#L244

which only returns True or False based on whether the status is 206 or not. This should be an issue asking to support redirects.

On the second issue of not being able to access the redirected file: I wasn't able to the first time, then I was every subsequent time. I verify that I can read the data in it. I don't know if this was a one-time GitHub thing or if it always needs to "warm up," or what.

@maxnoe
Copy link

maxnoe commented Oct 27, 2020

When you are at it, please don't forget the other redirect status codes:

https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#3xx_redirection

chrisburr added a commit to chrisburr/uproot4 that referenced this issue Nov 3, 2020
chrisburr added a commit to chrisburr/uproot4 that referenced this issue Nov 3, 2020
@jpivarski jpivarski linked a pull request Nov 20, 2020 that will close this issue
lobis added a commit that referenced this issue Oct 5, 2023
* use file in skhep testdata

* remove hyphen

* use tag instead of branch (#973 (comment))

* remove network pytest mark (#973 (comment))

* use proper http links instead of local paths

* update skip comment

* update comment
lobis added a commit that referenced this issue Oct 5, 2023
* origin/main:
  test: use file in skhep-testdata for issue #121 (#973)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants