MCPcopy Create free account
hub / github.com/chainreactors/EvilProxy / MaskAuthorizationHeader

Function MaskAuthorizationHeader

internal/util/provider.go:201–207  ·  view source on GitHub ↗

maskAuthorizationHeader masks the Authorization header value while preserving the auth type prefix. Common formats: "Bearer ", "Basic ", "ApiKey ", etc. It preserves the prefix (e.g., "Bearer ") and only masks the token/credential part. Parameters: - value: The Authorizatio

(value string)

Source from the content-addressed store, hash-verified

199// Returns:
200// - string: The masked Authorization value with prefix preserved
201func MaskAuthorizationHeader(value string) string {
202 parts := strings.SplitN(strings.TrimSpace(value), " ", 2)
203 if len(parts) < 2 {
204 return HideAPIKey(value)
205 }
206 return parts[0] + " " + HideAPIKey(parts[1])
207}
208
209// MaskSensitiveHeaderValue masks sensitive header values while preserving expected formats.
210//

Callers 1

MaskSensitiveHeaderValueFunction · 0.85

Calls 1

HideAPIKeyFunction · 0.85

Tested by

no test coverage detected