whitequark/rack-utf8_sanitizer

JavaScript content type

nburkley opened this issue · 3 comments

I'm just wondering why application/json and application/js aren't sanitizable content types?
https://github.com/whitequark/rack-utf8_sanitizer/blob/master/lib/rack/utf8_sanitizer.rb#L26

I have some character encoding issues in my application from js reqeusts that aren't covered with rack-utf8_sanitizer. Is there a specific reason for this?

bf4 commented

I was thinking of adding them, actually.

I, myself, have an initializer right now with

Rack::UTF8Sanitizer::SANITIZABLE_CONTENT_TYPES.concat %w[
  application/json
  text/javascript
]
bf4 commented

As to a reason, it was a new feature and I was being conservative, though provided a 'hook' to add them in the meantime.

Great, thanks for the info.