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

xbps-install doesn't follow 308 Permanent Redirects #579

Open
PhotonQuantum opened this issue Dec 23, 2023 · 0 comments
Open

xbps-install doesn't follow 308 Permanent Redirects #579

PhotonQuantum opened this issue Dec 23, 2023 · 0 comments

Comments

@PhotonQuantum
Copy link

Problem

~> sudo xbps-install -Sv                                                                                                                                                1 12/23/23 21:42:57 PM
[*] Updating repository `https://mirror.sjtu.edu.cn/voidlinux/current/x86_64-repodata' ...
ERROR: [reposync] failed to fetch file `https://mirror.sjtu.edu.cn/voidlinux/current/x86_64-repodata': Permanent Redirect
[*] Updating repository `https://mirror.sjtu.edu.cn/voidlinux/current/multilib/nonfree/x86_64-repodata' ...
ERROR: [reposync] failed to fetch file `https://mirror.sjtu.edu.cn/voidlinux/current/multilib/nonfree/x86_64-repodata': Permanent Redirect
[*] Updating repository `https://mirror.sjtu.edu.cn/voidlinux/current/multilib/x86_64-repodata' ...
ERROR: [reposync] failed to fetch file `https://mirror.sjtu.edu.cn/voidlinux/current/multilib/x86_64-repodata': Permanent Redirect
[*] Updating repository `https://mirror.sjtu.edu.cn/voidlinux/current/nonfree/x86_64-repodata' ...
ERROR: [reposync] failed to fetch file `https://mirror.sjtu.edu.cn/voidlinux/current/nonfree/x86_64-repodata': Permanent Redirect
~>

(mirror.sjtu.edu.cn is now using HTTP 302 to work around this issue)

Expected behavior

xbps should follow HTTP 308 redirects.

Suspected cause

xbps/lib/fetch/http.c

Lines 111 to 115 in b75e151

#define HTTP_REDIRECT(xyz) ((xyz) == HTTP_MOVED_PERM \
|| (xyz) == HTTP_MOVED_TEMP \
|| (xyz) == HTTP_TEMP_REDIRECT \
|| (xyz) == HTTP_USE_PROXY \
|| (xyz) == HTTP_SEE_OTHER)

I believe we can solve this issue by adding HTTP_PERM_REDIRECT to HTTP_REDIRECT.

Possible PR to blame: 90eb1d9

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

No branches or pull requests

1 participant