Skip to content

Commit

Permalink
Enable form data UTF-8 sanitisation
Browse files Browse the repository at this point in the history
  • Loading branch information
unoduetre committed Oct 25, 2024
1 parent 9b5f383 commit 0fde4dd
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 0 additions & 1 deletion config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ class Application < Rails::Application
config.middleware.insert_before(
Rack::Head,
Rack::UTF8Sanitizer,
sanitizable_content_types: [],
only: %w[QUERY_STRING],
strategy: Sanitiser::Strategy,
)
Expand Down
2 changes: 1 addition & 1 deletion lib/sanitiser/strategy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def call(input, sanitize_null_bytes: false)
raise NullByteInString
end
rescue StandardError
raise SanitisingError, "Non-UTF-8 (or null) character in the query or in the cookie"
raise SanitisingError, "Non-UTF-8 (or null) character in query, cookie or form data"
end
end
end
Expand Down

0 comments on commit 0fde4dd

Please sign in to comment.