Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom header sanitization #14

Open
chrishas35 opened this issue Jul 22, 2022 · 2 comments
Open

Custom header sanitization #14

chrishas35 opened this issue Jul 22, 2022 · 2 comments

Comments

@chrishas35
Copy link

I have a module that calls an API with a custom authorization header. I would like to sanitize it rather than hide it, but currently doesn't appear I can do so. The ability to add additional headers for sanitization would be a great addition.

@henvic
Copy link
Owner

henvic commented Aug 7, 2022

Hello @chrishas35,

Sorry for the delay in getting back to you. I just noticed your comment today.

Thanks. I'll consider it in an upcoming update.

For now, maybe something like the following works for you:

wedeploy.DefaultSanitizers["Custom-Header"] = AuthorizationSanitizer

as you can see in:

// DefaultSanitizers contains a list of sanitizers to be used for common headers.
var DefaultSanitizers = map[string]SanitizeHeaderFunc{
"Authorization": AuthorizationSanitizer,
"Set-Cookie": SetCookieSanitizer,
"Cookie": CookieSanitizer,
"Proxy-Authorization": AuthorizationSanitizer,
}

@titaneric
Copy link

May I ask how to use it? It seems that it's internal package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants