Skip to content

Commit

Permalink
Merge pull request #3816 from alphagov/2938-enable-form-data-sanitisa…
Browse files Browse the repository at this point in the history
…tion

Enable form data UTF-8 sanitisation
  • Loading branch information
unoduetre authored Oct 31, 2024
2 parents 458931b + ba469aa commit aa3fd99
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 @@ -130,7 +130,6 @@ class Application < Rails::Application
config.middleware.insert_before(
0,
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 the query, cookie or form data"
end
end
end
Expand Down

0 comments on commit aa3fd99

Please sign in to comment.