-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
str(request.headers)
is empty
#2985
Comments
for anyone passing by: this also messes up |
I can't reproduce this issue with the information provided. The following echoes back all headers sent by the browser: from flask import Flask, request
app = Flask(__name__)
@app.route("/")
def echo():
return request.headers.to_wsgi_list() Header code was refactored a bit when moving the type annotations in, but all tests continue to pass in both Werkzeug and Flask. If you can create a minimal reproducible example, I do want to trace what's happening. |
Hmm as a stand alone flask application I can also not reproduce it, but I can reproduce it in my pytest endpoint |
I think I might have a reproducible example, if I return |
Aha, I was too clever. |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
3.1.0
was OK in 3.0.6
str(request.headers)
is empty
I think it's the same issue. If headers are gone, I assume our auth won't work. This is a pretty big old monolith, and I'm definitely not able to create something reproducible this week. It's 16:46 Friday... I just noticed that 93 unit tests suddenly failed, with assertion for all sorts of values of status suddenly all being 401. Not sure how that works. Pinning to 3.0.6. for now, and will let you know if a fix for this missing headers problem fixes my problem or not. |
@magnus-lycka I understand now, yeah if you're sending custom auth headers maybe this is related. Headers aren't gone though, only |
thank you so much! |
Turns out my optimism was unfounded. My issue remains with 3.1.1. Sigh... I'll try to distill my issue and file a new issue. |
Greetings from changedetection.io, thanks for your work!
Our tests started failing, turns out related (somehow) to Werkzeug 3.1.0
We have a test endpoint that is looking at the headers that were sent with a request
https://github.com/dgtlmoon/changedetection.io/blob/7029d10f8bd22ac2379fcfe70bf57b67ebee69fc/changedetectionio/tests/util.py#L231
for example
but
request.headers
is always empty (by empty i mean contains\r\n
), downgrading to3.0.6
fixed it (from3.1.0
)Tried python 3.10, 3.11, and 3.12
Strangely, all other variables in
request
look perfectly OK, tcpdump shows the headers are being sent without problem, HTTP_ type vars in the request look OK toothanks!
The text was updated successfully, but these errors were encountered: