scope["scheme"] is set to comma-separated list when such a value is present in the X-Forwarded-Proto header #2102
Replies: 2 comments
-
example of downstream problem which is caused by this: getsentry/sentry-python#2370 |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
Kludex
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The
X-Forwarded-Proto
header is underspecified, but may contain comma-separated values in the wild, see e.g. the CloudFoundry gorouterIf this is the case, the
scope["scheme"]
will contain such comma-separated values. I think this is probably not what we want, as downstream users expect a single value here.This is where the copying from the header takes place:
uvicorn/uvicorn/middleware/proxy_headers.py
Line 70 in e2a3979
Compare how Django does this:
https://github.com/django/django/blob/main/django/http/request.py#L264
This seems to be a rather recent addition, the Django ticket contains more info about other projects with similar fixes.
https://code.djangoproject.com/ticket/33569
Beta Was this translation helpful? Give feedback.
All reactions