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

Follow redirect locations when resolving "child" requests #43

Open
rhullah opened this issue Aug 3, 2022 · 0 comments
Open

Follow redirect locations when resolving "child" requests #43

rhullah opened this issue Aug 3, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@rhullah
Copy link

rhullah commented Aug 3, 2022

Description

If a parent HTTP request returns a redirect respose, subsequent child requests should respect the redirect location from parent's response.

Parent Request Child Request
pack.toml [index].file
index.toml [[files]].file

Example

Parent Request for pack.toml: GET http://myserver/v1.19/pack.toml

> GET /v1.19/pack.toml
> HOST: myserver

< HTTP/1.1 301 Moved Permanently
< Location: http://myserver/v1.19.0/pack.toml

Expected Behavior:

With the example request/response above packwiz-installer should make subsequent child requests relative to the redirect response:
Child Index Request: http://myserver/v1.19.0/index.toml

Actual Behavior:

The current implementation makes subsequent child requests relative to original Parent pack.toml request:
Child Index Request: http://myserver/v1.19/index.toml


Fix on Web Server side:

I know that a simple fix for this is to setup a server-side redirect/rewrite for everything in the directory (/v1.19/* in the example), but packwiz-installer should respect location changes so that it's not constantly getting redirects responses.

@comp500 comp500 added the bug Something isn't working label Jan 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants