mirror of
https://github.com/minio/minio.git
synced 2025-08-11 00:26:57 +02:00
refactor: rename hasWildcardConfig to configHasWildcard for consistency
- Improves naming consistency with other function names - Applied gofumpt formatting for CI compliance - All tests continue to pass
This commit is contained in:
parent
a6d2d89b12
commit
d7d7bd5674
@ -668,7 +668,7 @@ func (w *corsCredentialsWrapper) Write(b []byte) (int, error) {
|
||||
return w.ResponseWriter.Write(b)
|
||||
}
|
||||
|
||||
func hasWildcardConfig() bool {
|
||||
func configHasWildcard() bool {
|
||||
for _, o := range globalAPIConfig.getCorsAllowOrigins() {
|
||||
if o == "*" {
|
||||
return true
|
||||
@ -686,7 +686,7 @@ func (w *corsCredentialsWrapper) fixCORSCredentialsViolation() {
|
||||
}
|
||||
|
||||
// CORS spec compliance: never allow credentials with wildcard origins
|
||||
if hdr.Get("Access-Control-Allow-Origin") == "*" || hasWildcardConfig() {
|
||||
if hdr.Get("Access-Control-Allow-Origin") == "*" || configHasWildcard() {
|
||||
hdr.Del("Access-Control-Allow-Credentials")
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user