You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have a Logger that extends from the Grape middleman base. This logger need to have access to the request from env["api.request"] in the after method, which when a http request is sent with no content_type defined env["api.request"].request is nil which raises an error.
We are currently mounted with the use method
The following is the middle man call trace. Our middleware is API::Logger.
# Middleware call trace
## GOOD, correct content_type
### Before
API::Logger
Grape::Middleware::Versioner::Path
Grape::Middleware::Formatter
- Calls app endpoint here, logs sql whatnot
### After
Grape::Middleware::Formatter
Grape::Middleware::Versioner::Path
API::Logger
## BAD, missing content_type
### Before
API::Logger
Grape::Middleware::Versioner::Path
Grape::Middleware::Formatter
- Does NOT hit api
### After
Grape::Middleware::Versioner::Path
API::Logger
- raises error because request is missing from env["api.endpoint"]
We have a Logger that extends from the Grape middleman base. This logger need to have access to the request from
env["api.request"]
in theafter
method, which when a http request is sent with no content_type definedenv["api.request"].request
is nil which raises an error.We are currently mounted with the
use
methodThe following is the middle man call trace. Our middleware is
API::Logger
.One weird part in the bad calls is it goes up.
but then one way down.
My question is the request deleted if it does not match the content_type required or is this a bug?
The text was updated successfully, but these errors were encountered: