Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

caddyhttp: Smarter path matching and rewriting #4948

Merged
merged 15 commits into from
Aug 16, 2022
Prev Previous commit
Next Next commit
Update rewrite docs
mholt committed Aug 11, 2022
commit 2fd853238b8a25c712eb83a8f60a02dc0a44abaa
7 changes: 5 additions & 2 deletions modules/caddyhttp/rewrite/rewrite.go
Original file line number Diff line number Diff line change
@@ -31,7 +31,7 @@ func init() {
caddy.RegisterModule(Rewrite{})
}

// Rewrite is a middleware which can rewrite HTTP requests.
// Rewrite is a middleware which can rewrite/mutate HTTP requests.
//
// The Method and URI properties are "setters" (the request URI
// will be overwritten with the given values). Other properties are
@@ -43,7 +43,10 @@ func init() {
// URL-decoded (unescaped, normalized) space. For modifiers, the
// paths are cleaned before being modified so that multiple,
// consecutive slashes are collapsed into a single slash, and dot
// components are resolved and removed.
// components are resolved and removed. In the special case of a
// prefix, suffix, or substring containing "//" (repeated slashes),
// then slashes will not be merged while cleaning the path so that
// the rewrite can be interpreted literally.
type Rewrite struct {
// Changes the request's HTTP verb.
Method string `json:"method,omitempty"`