Skip to content
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

Set more reasonable default header limits (64kb) #5931

Closed
wants to merge 3 commits into from

Conversation

mvanderlee
Copy link

What do these changes do?

Set more reasonable default header limits (64kb) and make them configurable via environment variables.
I opted to go with environment variables because it was a lot quicker and easier than traversing the entire callstack and adding it to the client code.

My use-case is to process responses from Trino, which has a default limit of 2MB, so configurability is a must.

Are there changes in behavior for the user?

No

Related issue number

#2304, at least partially.

Checklist

  • I think the code is well written
  • Unit tests for the changes exist
  • Documentation reflects the changes
  • If you provide code modification, please add yourself to CONTRIBUTORS.txt
    • The format is <Name> <Surname>.
    • Please keep alphabetical order, the file is sorted by names.
  • Add a new news fragment into the CHANGES folder
    • name it <issue_id>.<type> for example (588.bugfix)
    • if you don't have an issue_id change it to the pr id after creating the pr
    • ensure type is one of the following:
      • .feature: Signifying a new feature.
      • .bugfix: Signifying a bug fix.
      • .doc: Signifying a documentation improvement.
      • .removal: Signifying a deprecation or removal of public API.
      • .misc: A ticket has been closed, but it is not of interest to users.
    • Make sure to use full sentences with correct case and punctuation, for example: "Fix issue with non-ascii contents in doctest text files."

@psf-chronographer psf-chronographer bot added the bot:chronographer:provided There is a change note present in this PR label Aug 5, 2021
@asvetlov
Copy link
Member

NGINX has 8kb limit, aiohttp often follows nginx defaults.

Regarding dynamic limits configuration -- I agree, the feature is useful.
But the configuration should be controlled by Connector class, not globally by env vars.
aiohttp is a library, not a program.
If user wants to use env vars for configuration -- that is perfectly fine but out of aiohttp project scope.

I'm closing this PR but open for another proposal that configures HttpResponseParser in a way similar to timeouts, read_bufsize and auto_decompress configuration.

@asvetlov asvetlov closed this Oct 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bot:chronographer:provided There is a change note present in this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants