Repository navigation
http: decode URI-encoded HTMX request headers - #120
Merged
Merged
Conversation
HTMX 1.9.x and 2.x URI-encode a header value that the browser cannot send as is and mark it with an additional *-URI-AutoEncoded header. The string properties of HtmxRequestHeaders ignored the marker, so a Cyrillic hx-prompt answer reached the application as %D0%9F%D1%80... Decode the value when the marker is true. A value without the marker is returned as sent, because it may contain a literal percent sign. HTMX 4.x does not mark encoded values, so they are still returned as sent.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
HTMX 1.9.x and 2.x URI-encode a header value that the browser cannot send as is, such as Cyrillic text,
and mark it with an additional
*-URI-AutoEncodedheader.HtmxRequestHeadersignored the marker:PromptПривет%D0%9F%D1%80%D0%B8%D0%B2%D0%B5%D1%82ПриветTriggerid="форма"%D1%84%D0%BE%D1%80%D0%BC%D0%B0формаTriggerNamename="имя"%D0%B8%D0%BC%D1%8FимяTargethx-target="#цель"%D1%86%D0%B5%D0%BB%D1%8CцельString properties now decode a value when its marker is
true. A value without the marker is returned as sent,because it may contain a literal
%. The marker name is built only for a value that contains%,so other values do not allocate.
HTMX 4.x does not mark encoded values, so
Prompt,Target, andSourceare still returned as sent.