Skip to content

Files passing through Cloudflare can no longer be read over http #1453

@ariostas

Description

@ariostas

Some of the tests in the CI started failing. After looking into it, I found out that it is because something Cloudflare is doing is messing with the reported content length in the headers and messing things up.

Here's an example of a file that fails.

import uproot
uproot.open("http://scikit-hep.org/uproot3/examples/HZZ.root")

And here is how I see that there is a mismatch

import requests
r = requests.get("http://scikit-hep.org/uproot3/examples/HZZ.root")
print(f"reported length={r.headers['content-length']}, actual length={len(r.content)}")
# reported length=210860, actual length=217945

Using a direct link to that file works fine

import requests
r = requests.get("https://github.com/scikit-hep/uproot3/raw/refs/heads/gh-pages/examples/HZZ.root")
print(f"reported length={r.headers['content-length']}, actual length={len(r.content)}")
# reported length=217945, actual length=217945

This is not an bug in Uproot, but I'm just posting it here to document it and discuss it. I'll keep looking into it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug (unverified)The problem described would be a bug, but needs to be triaged

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions