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: use relative redirects #36

Merged
merged 2 commits into from
Nov 24, 2023
Merged

fix: use relative redirects #36

merged 2 commits into from
Nov 24, 2023

Conversation

OlivierDehaene
Copy link
Member

Copy link

@Wauplin Wauplin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Conceptual approval 👍

src/api/sync.rs Outdated
)
};

// Follow redirects until host does not match if the first host
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Follow redirects until host does not match if the first host
// Follow redirects until host does not match with the first host

src/api/sync.rs Outdated
Comment on lines 301 to 302
.get(response.get_url())
.set(RANGE, "bytes=0-0")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you happen to know why the GET range 0-0 instead of a HEAD?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because specific DNS routing rules with headers.
Although I'm not 100% sure if it's still needed.

Copy link
Collaborator

@Narsil Narsil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

I was under the impression we didn't need such rules anymore though.

@OlivierDehaene
Copy link
Member Author

OlivierDehaene commented Nov 24, 2023

We still need these rules when we get a redirect because of casing issues.
I added a test for this specific problem

@OlivierDehaene OlivierDehaene merged commit b167f69 into main Nov 24, 2023
3 checks passed
@jtsai-quid
Copy link

hi @OlivierDehaene,
Is there an expected date for the next release?
Many thanks

@zackangelo
Copy link

Can you release this fix to crates.io? I'm unable to download some models using it because huggingface URLs are returning redirects in some cases.

@LaurentMazare
Copy link
Collaborator

+1, @Narsil (or others) if you could make a release to crates.io, that would be great! Fwiw we get some errors Error: Header etag is missing on the llama-3.1 repos.

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.

Missing etag downloading TheBloke/Llama-2-7b-Chat-GGUF + llama-2-7b-chat.Q4_K_M.gguf (Tokio)
7 participants