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:
max-ts0gt 2025-07-24 09:27:18 +09:00
parent a6d2d89b12
commit d7d7bd5674

View File

@ -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")
}
}