Any request sent to a Rails controller gets an HTTP_
prefixed to it, as that's appended by ActionDispatch::HTTP.Headers
. Is there a way to prevent that (without overriding ActionDispatch::HTTP
, so that I can use my custom headers, as is and use those as keys for headers.@env
?
Remove the HTTP_ prefix in Rails headers
2.3k views Asked by absessive At
1
No, it's not possible. That's how the
ActionDispatch::Http::Headers
class is designed to normalize the headers.You can still use your custom headers. You just need to reference them as
HTTP_X_FOO
instead ofx-foo
.