Allow overriding MAX_URL_LENGTH via environment variable #3594
Unanswered
ruimartinsptl
asked this question in
Potential Issue
Replies: 1 comment 2 replies
-
You're welcome to expand on your use case? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Motivation
Currently, HTTPX enforces a hardcoded
MAX_URL_LENGTH
(default value:65536
) inside the file httpx/_urlparse.py.In some exceptional use cases, users may need to send requests with longer URLs.
I have a use case that if uses
requests
, it works well, but usinghttpx
, I have an errorURL too long
Proposal
Allow overriding the
MAX_URL_LENGTH
constant via an environment variable, e.g.,HTTPX_MAX_URL_LENGTH
.(If the environment variable is not set, the default value (65536) would be used)
Example implementation:
Replace this:
by this:
Alternatives considered
httpx.Client
(andhttpx.AsyncClient
) constructor (several disadvantages)Benefits
Would this change be welcome? If so, I can open an issue (and then a pull request)
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions