Skip to content

Commit b81356d

Browse files
nicolasrodaldas
authored andcommitted
Update rewrite.md
In the last example the Rules And RegexRules from the config structure are shown as Rewrite and RewriteRules instead.
1 parent 6932acf commit b81356d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

website/content/middleware/rewrite.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,10 @@ Normal capture groups can be defined using `()` and referenced by index (`$1`, `
6767

6868
```go
6969
e.Pre(RewriteWithConfig(RewriteConfig{
70-
Rewrite: map[string]string{
70+
Rules: map[string]string{
7171
"^/v1/*": "/v2/$1",
7272
},
73-
RegexRewrite: map[*regexp.Regexp]string{
73+
RegexRules: map[*regexp.Regexp]string{
7474
regexp.MustCompile("^/foo/([0-9].*)"): "/num/$1",
7575
regexp.MustCompile("^/bar/(.+?)/(.*)"): "/baz/$2/$1",
7676
},

0 commit comments

Comments
 (0)