Skip to content

requests: Add support for relative redirect URLs.#1128

Open
dpgeorge wants to merge 1 commit into
micropython:masterfrom
dpgeorge:requests-support-relative-redirect
Open

requests: Add support for relative redirect URLs.#1128
dpgeorge wants to merge 1 commit into
micropython:masterfrom
dpgeorge:requests-support-relative-redirect

Conversation

@dpgeorge

Copy link
Copy Markdown
Member

Summary

A redirection URL in the "Location:" header may be relative and start with a "/". Handle such cases.

Testing

Added a unit test that runs under CI.

Also tested the case in #1127 and it now works.

Generative AI

Not used.

A redirection URL in the "Location:" header may be relative and start with
a "/".  Handle such cases.

Signed-off-by: Damien George <damien@micropython.org>
@o-murphy

Copy link
Copy Markdown

@dpgeorge
Does it resolves both /../ and /./ subpaths?

@dpgeorge

Copy link
Copy Markdown
Member Author

Does it resolves both /../ and /./ subpaths?

Yes.

It's not actually about the path, it's about the server responding with a redirect that normalises the path, and that redirect is relative instead of starting with https://.

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.

2 participants