URL encoding lost upon round trip through login #2074

Closed
opened 2025-11-02 04:23:18 -06:00 by GiteaMirror · 3 comments
Owner

Originally created by @Conduitry on GitHub (Jul 19, 2018).

If you are logged out and at a url containing an encoded # (i.e., %23), and then you click 'sign in' and complete the sign-in, you end up at the original url but with an actual # in it instead of a %23.

In the first navigation (upon clicking 'sign in') you are brought to a page with a ?redirect_to= value containing %2523, which seems correct. The set-cookie header that's returned also contains %2523, which I think is correct. It's not going through the layer of query param encoding, but it is going through the layer of cookie header encoding.

In the second navigation (upon entering your username/password and clicking 'sign in'), the redirect from the server has a location header that includes a # though, which is definitely incorrect.

This is on Gitea version 1e2da5d

Originally created by @Conduitry on GitHub (Jul 19, 2018). If you are logged out and at a url containing an encoded `#` (i.e., `%23`), and then you click 'sign in' and complete the sign-in, you end up at the original url but with an actual `#` in it instead of a `%23`. In the first navigation (upon clicking 'sign in') you are brought to a page with a `?redirect_to=` value containing `%2523`, which seems correct. The `set-cookie` header that's returned also contains `%2523`, which I _think_ is correct. It's not going through the layer of query param encoding, but it is going through the layer of cookie header encoding. In the second navigation (upon entering your username/password and clicking 'sign in'), the redirect from the server has a `location` header that includes a `#` though, which is definitely incorrect. This is on Gitea version 1e2da5d
GiteaMirror added the issue/confirmedtype/bug labels 2025-11-02 04:23:18 -06:00
Author
Owner

@stale[bot] commented on GitHub (Jan 17, 2019):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.

@stale[bot] commented on GitHub (Jan 17, 2019): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.
Author
Owner

@Conduitry commented on GitHub (Jan 18, 2019):

It looks like this is still occurring. I don't think the issue should be closed.

@Conduitry commented on GitHub (Jan 18, 2019): It looks like this is still occurring. I don't think the issue should be closed.
Author
Owner

@stale[bot] commented on GitHub (Mar 19, 2019):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.

@stale[bot] commented on GitHub (Mar 19, 2019): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#2074