-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
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
Does not abide by Rack SPEC #4
Comments
Quick workaround, simply rename the key by hand: module BodyParser
# To abide by Rack::Lint, where without a dot in the key name it should be string (here, it can be
# a Hash instead, so Rack::Lint throws)
class KeyRenamer
FROM_KEY = 'parsed_body'
TO_KEY = 'parsed_body.document'
def initialize(app, _opts = {})
@app = app
end
def call(env)
new_env = env
if new_env.key?(FROM_KEY)
new_env[TO_KEY] = new_env[FROM_KEY]
new_env.delete(FROM_KEY)
end
@app.call(new_env)
end
end
end |
Btw, formal spec is here, which states:
|
Thanks for raising this issue. I'll try to update asap. I'll bump the version to express the breaking change. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Rack::Lint
enforces SPEC:Thus, enabling
Rack::Lint
middleware generates an exception:The CGI keys (named without a period) must have String values.
suggests a fix would be to rename it tobody_parser.document
or something like that, to abide by the convention. Although of course it would be a breaking change.The text was updated successfully, but these errors were encountered: