I am adding application specific headers in my GET request. I am able to view the header in my Chrome's developer console. So it seems they are being sent to the server.
The header is chart_type
But, when I try to access the headers in my flask application it, is missing from request.headers
The output of request.headers is below:
X-Forwarded-For: 127.0.0.1
Host: localhost
X-Nginx-Proxy: true
Connection: close
Pragma: no-cache
Cache-Control: no-cache
Sec-Ch-Ua: "Not?A_Brand";v="8", "Chromium";v="108", "Google Chrome";v="108"
Sec-Ch-Ua-Mobile: ?0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36
Sec-Ch-Ua-Platform: "macOS"
Accept: */*
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: cors
Sec-Fetch-Dest: empty
Referer: http://localhost:8080/stock-market-pattern-modelling/quote?symbol=AAPL
Accept-Encoding: gzip, deflate, br
Accept-Language: en-US,en;q=0.9
While underscores are allowed in header names, some server implementations silently drop headers with underscores in the name.
For instance Nginx with the default configuration will ignore headers with underscore in the name (see underscores_in_headers
and ignore_invalid_headers
documentation).
I therefore suggest that you try the header name Chart-Type
instead of chart_type
.
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