Skip to content

fix(http): don't redirect query-string URLs on private containers - #141

Open
bourgeoa wants to merge 1 commit into
mainfrom
fix/responseWriter
Open

fix(http): don't redirect query-string URLs on private containers#141
bourgeoa wants to merge 1 commit into
mainfrom
fix/responseWriter

Conversation

@bourgeoa

Copy link
Copy Markdown
Member

PivotResponseWriter intercepted 401/403/404 GET responses and redirected to a trailing-slash variant of the URL, but it checked the raw request URL (which includes the query string) for the trailing slash. As a result, OIDC redirects back to a private container (e.g. /?code=...&state=...&iss=...) were 301-redirected to a query-less '//' URL, dropping the authorization code and breaking login on non-public-readable containers.

Only canonicalize when the identifier path genuinely lacks a trailing slash, so private containers return their normal 401 with the query string intact and the login flow can complete.

PivotResponseWriter intercepted 401/403/404 GET responses and redirected
to a trailing-slash variant of the URL, but it checked the raw request
URL (which includes the query string) for the trailing slash. As a
result, OIDC redirects back to a private container (e.g. /?code=...&state=...&iss=...)
were 301-redirected to a query-less '//' URL, dropping the authorization
code and breaking login on non-public-readable containers.

Only canonicalize when the identifier path genuinely lacks a trailing
slash, so private containers return their normal 401 with the query
string intact and the login flow can complete.
@bourgeoa bourgeoa self-assigned this Aug 21, 2026
@bourgeoa bourgeoa added the bug Something isn't working label Aug 21, 2026
@bourgeoa bourgeoa linked an issue Aug 21, 2026 that may be closed by this pull request
@uvdsl

uvdsl commented Aug 21, 2026

Copy link
Copy Markdown

Is that custom to Pivot? Because #324 occurred on a rather plain (yet custom WAC for client checks) of CSS (I am not running Pivot).

@bourgeoa

bourgeoa commented Aug 21, 2026

Copy link
Copy Markdown
Member Author

From m'y tests this is Pivot specific.

You can test login with any pod account to https://solidweb.me/bourgeoa1/settings/ with a / at end
/settings/ is private.
This a pure CSS v7.2.0 (not running Pivot) with mashlib V2.2.2
You can login

So yes the issue do not appear on a clean CSS that do not accept URL container not ending with /

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

Successfully merging this pull request may close these issues.

don't redirect query-string URLs on private containers

2 participants