It appears Django has request.META: a dictionary of the request's headers in CAPITAL_UNDERSCORE format - like: "X_FORWARDED_FOR".
Is there a similar construct for Flask?
(I am aware of flask's request.headers (which contains headers in "x-forwarded-for" format))
This is the way for the framework to expose headers. Django chooses to expose it full capital with underscores and the real input from the server is something like that: X-Forwarded-For on apache2.
All this to say that Flask expose you headers in only one way. You can always convert it using .upper().replace('-', '_') if you really need it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With