How would you encode response headers?

I want to add a custom content-disposition response header with an untrusted user input. Normally I would just use UrlEncode or HtmlEncode from the AntiXss Library, but this would replace the whitespaces with a plus sign and sometimes create an invalid content-disposition string.

Is there any library which is designed for encoding header values?

submitted by /u/BlockEncryptor
[link] [comments]

Leave a Reply