1
0
Fork 0

Fix regexp handling in redirect middleware

This commit is contained in:
Tom Moulard 2022-04-15 17:24:08 +02:00 committed by GitHub
parent ad3625bef3
commit 232e2c1e7d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 16 deletions

View file

@ -15,6 +15,8 @@ const (
schemeHTTPS = "https"
)
var uriRegexp = regexp.MustCompile(`^(https?):\/\/(\[[\w:.]+\]|[\w\._-]+)?(:\d+)?(.*)$`)
type redirect struct {
next http.Handler
regex *regexp.Regexp