Skip to content

caddyhttp: add replacer placeholders for escaped values - #7181

Merged
mholt merged 1 commit into
caddyserver:masterfrom
Qusic:escaped
Aug 25, 2025
Merged

mholt merged 1 commit into
caddyserver:masterfrom
Qusic:escaped

Conversation

@Qusic

@Qusic Qusic commented Aug 13, 2025

Copy link
Copy Markdown
Contributor

basically this brings back this v1 change #470

adding uri_escaped, path_escaped, query_escaped being the url.QueryEscaped version of original values

useful for such cases: https://caddy.community/t/how-to-percent-encode-request-url-when-redirecting/30982

@CLAassistant

CLAassistant commented Aug 13, 2025 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@mholt

mholt commented Aug 21, 2025

Copy link
Copy Markdown
Member

Thanks, I was actually curious though, should we do something like {%path}? That almost makes it clearer that it's URI escaping in particular. (as opposed to \ escapes or something).

@francislavoie

Copy link
Copy Markdown
Member

@mholt I agree for the shortcut, but the long form should probably just be plain English to make sure we don't run into issues with regex character sets not including those special characters etc.

@mholt

mholt commented Aug 21, 2025

Copy link
Copy Markdown
Member

That's a good point.

Comment thread caddyconfig/httpcaddyfile/shorthands.go Resolved

@mholt mholt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great - thanks!

@mholt
mholt merged commit 5e29536 into caddyserver:master Aug 25, 2025
@Qusic
Qusic deleted the escaped branch August 25, 2025 15:08
@mohammed90 mohammed90 mentioned this pull request Oct 25, 2025
46 tasks done
@github-actions github-actions Bot mentioned this pull request Dec 3, 2025
4 tasks
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.

4 participants