Skip to content

http: document non-ASCII values in response headers - #119

Merged
rameel merged 1 commit into
mainfrom
http/document-non-ascii-response-headers
Nov 2, 2026
Merged

rameel merged 1 commit into
mainfrom
http/document-non-ascii-response-headers

Conversation

@rameel

@rameel rameel commented Nov 2, 2026 •

Copy link
Copy Markdown
Owner

Location, Redirect, PushUrl, ReplaceUrl, Retarget, and Reselect write a string into a response header, and Kestrel throws InvalidOperationException for a non-ASCII value, just as it does for Results.Redirect("/путь").

HTMX uses these header values as they are, so the encoding depends on where the value ends up.

Checked in a browser against HTMX 1.9.12, 2.0.11, and 4.0.0:

Encoding URLs Selectors
Percent-encoding Works Fails
CSS escapes Not applicable Works
Raw UTF-8 (ResponseHeaderEncodingSelector) Wrong address Fails

@rameel
rameel merged commit 00683a0 into main Nov 2, 2026
1 check passed
@rameel
rameel deleted the http/document-non-ascii-response-headers branch November 2, 2026 17:09
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.

1 participant