Browse Source
refactor: Performance and readability improvement on isDefaultPort (#6960)
pull/6962/head
Joon Young Baik
3 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
8 additions and
3 deletions
-
weed/s3api/auth_signature_v4.go
|
|
@ -763,9 +763,14 @@ func isDefaultPort(scheme, port string) bool { |
|
|
|
return true |
|
|
|
} |
|
|
|
|
|
|
|
lowerCaseScheme := strings.ToLower(scheme) |
|
|
|
return (lowerCaseScheme == "http" && port == "80") || |
|
|
|
(lowerCaseScheme == "https" && port == "443") |
|
|
|
switch port { |
|
|
|
case "80": |
|
|
|
return strings.EqualFold(scheme, "http") |
|
|
|
case "443": |
|
|
|
return strings.EqualFold(scheme, "https") |
|
|
|
default: |
|
|
|
return false |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// getSignedHeaders generate a string i.e alphabetically sorted, semicolon-separated list of lowercase request header names
|
|
|
|