René's URL Explorer Experiment


Title: http.client._MAXHEADERS = 100 limit no longer sufficient · Issue #131724 · python/cpython · GitHub

Open Graph Title: http.client._MAXHEADERS = 100 limit no longer sufficient · Issue #131724 · python/cpython

X Title: http.client._MAXHEADERS = 100 limit no longer sufficient · Issue #131724 · python/cpython

Description: Bug report Bug description: This hard-coded sanity check for HTTP response headers is no longer sufficient to fetch a Microsoft 365 page. cpython/Lib/http/client.py Line 112 in 0a91456 _MAXHEADERS = 100 I do have a case open with Microso...

Open Graph Description: Bug report Bug description: This hard-coded sanity check for HTTP response headers is no longer sufficient to fetch a Microsoft 365 page. cpython/Lib/http/client.py Line 112 in 0a91456 _MAXHEADERS ...

X Description: Bug report Bug description: This hard-coded sanity check for HTTP response headers is no longer sufficient to fetch a Microsoft 365 page. cpython/Lib/http/client.py Line 112 in 0a91456 _MAXHEADERS ...

Opengraph URL: https://github.com/python/cpython/issues/131724

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"http.client._MAXHEADERS = 100 limit no longer sufficient","articleBody":"# Bug report\n\n### Bug description:\n\nThis hard-coded sanity check for HTTP response headers is no longer sufficient to fetch a Microsoft 365 page.  \n\nhttps://github.com/python/cpython/blob/0a91456ad14bb598646f50bf8f034e8887c0c468/Lib/http/client.py#L112\n\nI do have a case open with Microsoft Support (TrackingID#2503130010002871), but it's not getting much traction as it's not causing problems with full web browsers.\n\nSteps to reproduce:\n\n```python\nimport http.client\ncon = http.client.HTTPSConnection('outlook.office365.com')\ncon.request(\"GET\", \"/owa/example.edu\")  # any domain seems to trigger\nr = con.getresponse()\n```\n\nAnd that throws a HTTPException\n```\n>>> con = http.client.HTTPSConnection('outlook.office365.com')\n>>> con.request(\"GET\", \"/owa/foo.bar\")\n>>> r = con.getresponse()\nTraceback (most recent call last):\n  File \"\u003cpython-input-8>\", line 1, in \u003cmodule>\n    r = con.getresponse()\n  File \"C:\\Users\\jmacdone\\AppData\\Local\\Programs\\Python\\Python313-arm64\\Lib\\http\\client.py\", line 1428, in getresponse\n    response.begin()\n    ~~~~~~~~~~~~~~^^\n  File \"C:\\Users\\jmacdone\\AppData\\Local\\Programs\\Python\\Python313-arm64\\Lib\\http\\client.py\", line 350, in begin\n    self.headers = self.msg = parse_headers(self.fp)\n                              ~~~~~~~~~~~~~^^^^^^^^^\n  File \"C:\\Users\\jmacdone\\AppData\\Local\\Programs\\Python\\Python313-arm64\\Lib\\http\\client.py\", line 248, in parse_headers\n    headers = _read_headers(fp)\n  File \"C:\\Users\\jmacdone\\AppData\\Local\\Programs\\Python\\Python313-arm64\\Lib\\http\\client.py\", line 226, in _read_headers\n    raise HTTPException(\"got more than %d headers\" % _MAXHEADERS)\nhttp.client.HTTPException: got more than 100 headers\n>>>\n```\n\nIt seems to be just spilling over with 101 headers. Though, not consistently.  Presumably it depends upon which load balancer node is responding.\n\n\n```bash\n$ curl --silent -D - 'https://outlook.office365.com/owa/example.edu' | grep -E \"^[a-zA-Z-]+: \" | wc -l\n```\nreturns with 96, 99, 101, etc. headers, depending on ~Microsoft's mood~ unknown factors.\n\nFor background, it's common to use `https://outlook.com/example.edu` as a domain hint (\"smart link\") to go directly to a tenant's identity provider and avoid the \"Please provide your email address\" step.  We have a nagios check for that, which broke recently as the number of  `Set-Cookie:  OpenIdConnect.token.[...]` variants continues to grow.\n\n### CPython versions tested on:\n\n3.13, 3.9, 3.11\n\n### Operating systems tested on:\n\nLinux, Windows\n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-136814\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/jmacdone","@type":"Person","name":"jmacdone"},"datePublished":"2025-03-25T16:27:47Z","url":"https://github.com/python/cpython/issues/131724"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:d0cef262-6981-acd1-fe38-9a16277e01df
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idC222:1F6DC:20722D:2B75EF:6AECC433
html-safe-nonce9cb74d97c760669afc4374971109c4fc39b2348aee1322be75149795c782f67a
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMjIyOjFGNkRDOjIwNzIyRDoyQjc1RUY6NkFFQ0M0MzMiLCJ2aXNpdG9yX2lkIjoiNDE5MzQ3MDgwODIwMzI0ODY5MSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac578ae77fed198378ac12ad442859c3d0ae316e099a1b935d90372d3761828f14
hovercard-subject-tagissue:2947117446
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/131724/issue_layout
twitter:imagehttps://opengraph.githubassets.com/c59d062eb198918dad01a252d8601d2e2719b5a76f2ff246acf0e8b111fa43d1/python/cpython/issues/131724
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/c59d062eb198918dad01a252d8601d2e2719b5a76f2ff246acf0e8b111fa43d1/python/cpython/issues/131724
og:image:altBug report Bug description: This hard-coded sanity check for HTTP response headers is no longer sufficient to fetch a Microsoft 365 page. cpython/Lib/http/client.py Line 112 in 0a91456 _MAXHEADERS ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamejmacdone
hostnamegithub.com
expected-hostnamegithub.com
Nonedc0b519c5798dc1150b88dc4c06a8b9634d0069218dc04e469970e76aad74016
turbo-cache-controlno-preview
go-importgithub.com/python/cpython git https://github.com/python/cpython.git
octolytics-dimension-user_id1525981
octolytics-dimension-user_loginpython
octolytics-dimension-repository_id81598961
octolytics-dimension-repository_nwopython/cpython
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id81598961
octolytics-dimension-repository_network_root_nwopython/cpython
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasedb139f0bf57b59bf9a8c4abb0849924d6c6ca559
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/python/cpython/issues/131724#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F131724
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F131724
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=python%2Fcpython
Reloadhttps://github.com/python/cpython/issues/131724
Reloadhttps://github.com/python/cpython/issues/131724
Reloadhttps://github.com/python/cpython/issues/131724
pythonhttps://github.com/python
cpythonhttps://github.com/python/cpython
Codehttps://github.com/python/cpython
Issues5k+ (5k+)https://github.com/python/cpython/issues
Pull requests2.3k (2.3k)https://github.com/python/cpython/pulls
Actionshttps://github.com/python/cpython/actions
Projectshttps://github.com/python/cpython/projects
Security and qualityhttps://github.com/python/cpython/security
Insightshttps://github.com/python/cpython/pulse
https://github.com/python/cpython
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/131724
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/131724
http.client._MAXHEADERS = 100 limit no longer sufficienthttps://github.com/python/cpython/issues/131724#top
stdlibStandard Library Python modules in the Lib/ directoryhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22stdlib%22
type-bugAn unexpected behavior, bug, or errorhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-bug%22
https://github.com/jmacdone
jmacdonehttps://github.com/jmacdone
on Mar 25, 2025https://github.com/python/cpython/issues/131724#issue-2947117446
cpython/Lib/http/client.pyhttps://github.com/python/cpython/blob/0a91456ad14bb598646f50bf8f034e8887c0c468/Lib/http/client.py#L112
0a91456https://github.com/python/cpython/commit/0a91456ad14bb598646f50bf8f034e8887c0c468
gh-131724: Add a new max_response_headers param to HTTP/HTTPSConnection #136814https://github.com/python/cpython/pull/136814
jmacdonehttps://github.com/jmacdone
type-bugAn unexpected behavior, bug, or errorhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-bug%22
on Mar 25, 2025https://github.com/python/cpython/issues/131724#event-16978081388
https://github.com/StanFromIreland
StanFromIrelandhttps://github.com/StanFromIreland
on Mar 25, 2025https://github.com/python/cpython/issues/131724#issuecomment-2751878711
picnixzhttps://github.com/picnixz
stdlibStandard Library Python modules in the Lib/ directoryhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22stdlib%22
on Mar 28, 2025https://github.com/python/cpython/issues/131724#event-17032438949
https://github.com/jmacdone
jmacdonehttps://github.com/jmacdone
on Mar 28, 2025https://github.com/python/cpython/issues/131724#issuecomment-2761799521
@StanFromIrelandhttps://github.com/StanFromIreland
cpython/Lib/http/client.pyhttps://github.com/python/cpython/blob/0a91456ad14bb598646f50bf8f034e8887c0c468/Lib/http/client.py#L1454
0a91456https://github.com/python/cpython/commit/0a91456ad14bb598646f50bf8f034e8887c0c468
https://github.com/vstinner
vstinnerhttps://github.com/vstinner
on Mar 28, 2025https://github.com/python/cpython/issues/131724#issuecomment-2761810825
https://github.com/gostak-dd
gostak-ddhttps://github.com/gostak-dd
on May 20, 2025https://github.com/python/cpython/issues/131724#issuecomment-2895009280
https://github.com/jmacdone
jmacdonehttps://github.com/jmacdone
on May 20, 2025https://github.com/python/cpython/issues/131724#issuecomment-2895131153
#131724 (comment)https://github.com/python/cpython/issues/131724#issuecomment-2761799521
https://github.com/vstinner
vstinnerhttps://github.com/vstinner
on May 20, 2025https://github.com/python/cpython/issues/131724#issuecomment-2895437740
https://github.com/aeurielesn
aeurielesnhttps://github.com/aeurielesn
on Jul 19, 2025https://github.com/python/cpython/issues/131724#issuecomment-3092209153
aeurielesnhttps://github.com/aeurielesn
on Jul 19, 2025https://github.com/python/cpython/issues/131724#event-18711407640
pythongh-131724: Add a new max_headers param to HTTP/HTTPSConnection …https://github.com/aeurielesn/cpython/commit/4a2ceeeec0d23648e615a509d80f194c438de97d
pythongh-131724https://github.com/python/cpython/issues/131724
4a2ceeehttps://github.com/aeurielesn/cpython/commit/4a2ceeeec0d23648e615a509d80f194c438de97d
pythongh-131724: Add a new max_headers param to HTTP/HTTPSConnectionhttps://github.com/aeurielesn/cpython/commit/50976d1c88a2691c3d8870d86e11c357aad5b830
pythongh-131724https://github.com/python/cpython/issues/131724
50976d1https://github.com/aeurielesn/cpython/commit/50976d1c88a2691c3d8870d86e11c357aad5b830
pythongh-131724: Add a new max_headers param to HTTP/HTTPSConnectionhttps://github.com/aeurielesn/cpython/commit/a24a88d782833c5f5732070542b75b66fc20632b
pythongh-131724https://github.com/python/cpython/issues/131724
a24a88dhttps://github.com/aeurielesn/cpython/commit/a24a88d782833c5f5732070542b75b66fc20632b
Merge branch 'main' into pythongh-131724https://github.com/aeurielesn/cpython/commit/24d5c4a05fdfebbab582b061f36bf4724fea5e93
pythongh-131724https://github.com/python/cpython/issues/131724
24d5c4ahttps://github.com/aeurielesn/cpython/commit/24d5c4a05fdfebbab582b061f36bf4724fea5e93
encukouhttps://github.com/encukou
on Jul 20, 2025https://github.com/python/cpython/issues/131724#event-18716650406
gh-131724: Add a new max_response_headers param to HTTP/HTTPSConnecti…https://github.com/python/cpython/commit/958657bbc3351c66dd8e319503675521bfdea49a
gh-131724https://github.com/python/cpython/issues/131724
958657bhttps://github.com/python/cpython/commit/958657bbc3351c66dd8e319503675521bfdea49a
https://github.com/encukou
encukouhttps://github.com/encukou
on Jul 22, 2025https://github.com/python/cpython/issues/131724#issuecomment-3102466616
@aeurielesnhttps://github.com/aeurielesn
encukouhttps://github.com/encukou
completedhttps://github.com/python/cpython/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Jul 22, 2025https://github.com/python/cpython/issues/131724#event-18751019347
taegyunkimhttps://github.com/taegyunkim
on Aug 4, 2025https://github.com/python/cpython/issues/131724#event-18976855377
pythongh-131724: Add a new max_response_headers param to HTTP/HTTPSCo…https://github.com/taegyunkim/cpython/commit/ef8084323d217fbe9d162837b1c3b0ffbe020117
pythongh-131724https://github.com/python/cpython/issues/131724
ef80843https://github.com/taegyunkim/cpython/commit/ef8084323d217fbe9d162837b1c3b0ffbe020117
Agent-Hellboyhttps://github.com/Agent-Hellboy
on Aug 19, 2025https://github.com/python/cpython/issues/131724#event-19221815279
pythongh-131724: Add a new max_response_headers param to HTTP/HTTPSCo…https://github.com/Agent-Hellboy/cpython/commit/48603cd4abb9f232881b310980ae00f71b0031d4
pythongh-131724https://github.com/python/cpython/issues/131724
48603cdhttps://github.com/Agent-Hellboy/cpython/commit/48603cd4abb9f232881b310980ae00f71b0031d4
Sign up for freehttps://github.com/signup?return_to=https://github.com/python/cpython/issues/131724
Sign in to commenthttps://github.com/login?return_to=https://github.com/python/cpython/issues/131724
stdlibStandard Library Python modules in the Lib/ directoryhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22stdlib%22
type-bugAn unexpected behavior, bug, or errorhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-bug%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.