fix cors domain normalize

pull/2883/head v2.52.1
René Werner 2024-02-21 21:18:56 +01:00
parent f9fcb0297c
commit 70f21d5f7e
1 changed files with 4 additions and 2 deletions

View File

@ -49,8 +49,10 @@ func normalizeDomain(input string) string {
input = strings.TrimPrefix(strings.TrimPrefix(input, "http://"), "https://")
// Find and remove port, if present
if portIndex := strings.Index(input, ":"); portIndex != -1 {
input = input[:portIndex]
if len(input) > 0 && input[0] != '[' {
if portIndex := strings.Index(input, ":"); portIndex != -1 {
input = input[:portIndex]
}
}
return input