We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f9fcb02 commit 70f21d5Copy full SHA for 70f21d5
middleware/cors/utils.go
@@ -49,8 +49,10 @@ func normalizeDomain(input string) string {
49
input = strings.TrimPrefix(strings.TrimPrefix(input, "http://"), "https://")
50
51
// Find and remove port, if present
52
- if portIndex := strings.Index(input, ":"); portIndex != -1 {
53
- input = input[:portIndex]
+ if len(input) > 0 && input[0] != '[' {
+ if portIndex := strings.Index(input, ":"); portIndex != -1 {
54
+ input = input[:portIndex]
55
+ }
56
}
57
58
return input
0 commit comments