We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
ArgumentError
parameters
We use GrapeLogging::Middleware::RequestLogger like below:
GrapeLogging::Middleware::RequestLogger
class MyApi < Grape::API use GrapeLogging::Middleware::RequestLogger, { include: [GrapeLogging::Loggers::FilterParameters.new], } post {} end
If we send a request whose body includes invalid byte sequence, ArgumentError is raised.
echo -e '{"\xff":1}' | curl -X POST -H 'Content-Type: application/json' localhost:3000 --data-binary @-
Here is the server log:
ArgumentError (invalid byte sequence in UTF-8): actionpack (5.2.1) lib/action_dispatch/http/parameter_filter.rb:63:in `=~' actionpack (5.2.1) lib/action_dispatch/http/parameter_filter.rb:63:in `block (2 levels) in call' actionpack (5.2.1) lib/action_dispatch/http/parameter_filter.rb:63:in `any?' actionpack (5.2.1) lib/action_dispatch/http/parameter_filter.rb:63:in `block in call' actionpack (5.2.1) lib/action_dispatch/http/parameter_filter.rb:61:in `each' actionpack (5.2.1) lib/action_dispatch/http/parameter_filter.rb:61:in `call' actionpack (5.2.1) lib/action_dispatch/http/parameter_filter.rb:15:in `filter' grape_logging (1.7.0) lib/grape_logging/loggers/filter_parameters.rb:32:in `clean_parameters' grape_logging (1.7.0) lib/grape_logging/loggers/filter_parameters.rb:27:in `safe_parameters' grape_logging (1.7.0) lib/grape_logging/loggers/filter_parameters.rb:13:in `parameters' grape_logging (1.7.0) lib/grape_logging/middleware/request_logger.rb:140:in `block (2 levels) in collect_parameters' (snip)
The text was updated successfully, but these errors were encountered:
Scrub parameter keys
2e601c7
This commit resolves aserafin#53.
ca4061e
Convert parameter keys to ASCII-8BIT
4853efc
Convert parameter keys to ASCII-8BIT before filtering
58e7475
Successfully merging a pull request may close this issue.
We use
GrapeLogging::Middleware::RequestLogger
like below:If we send a request whose body includes invalid byte sequence,
ArgumentError
is raised.Here is the server log:
The text was updated successfully, but these errors were encountered: