René's URL Explorer Experiment


Title: fix: Let httpx2 choose the multipart/form-data boundary by RClaudiuM · Pull Request #1511 · openapi-generators/openapi-python-client · GitHub

Open Graph Title: fix: Let httpx2 choose the multipart/form-data boundary by RClaudiuM · Pull Request #1511 · openapi-generators/openapi-python-client

X Title: fix: Let httpx2 choose the multipart/form-data boundary by RClaudiuM · Pull Request #1511 · openapi-generators/openapi-python-client

Description: Fixes #1509 Since #1005 every generated multipart/form-data request sets Content-Type: multipart/form-data; boundary=+++. httpx2 builds the body with that boundary, so a file that contains \r\n--+++ is split there and the server gets a truncated file plus a stray part. This stops setting Content-Type for multipart/form-data bodies. httpx2 then adds the header with its own random boundary, the same way single-body endpoints worked before 0.29.0. For endpoints with several body types, the multipart branch no longer sets the header either, so #947 stays fixed: httpx2 still writes a boundary because the header isn't set. The other content types still set their header explicitly. Changes: endpoint_module.py.jinja: skip the Content-Type line for multipart bodies. Golden records and the integration-test client regenerated (only the boundary=+++ line goes away). New functional test test_multipart_bodies.py: generates a single-body and a multi-body endpoint, sends a file containing \r\n--+++ through a MockTransport and parses the multipart body back. Patch changeset. Testing: pytest end_to_end_tests/functional_tests/generated_code_execution/test_multipart_bodies.py before the template change: 2 failed ({'file': b'first line'} != {'file': b'first line\r\n--+++\r\nstill the same file\r\n'}), 1 passed (JSON control) after: 3 passed Full pdm test equivalent with coverage: 471 passed, 100% coverage, 5 snapshots passed ruff format --check ., ruff check ., mypy openapi_python_client fuzz pass I didn't run the integration job locally because it needs the openapi-test-server container.

Open Graph Description: Fixes #1509 Since #1005 every generated multipart/form-data request sets Content-Type: multipart/form-data; boundary=+++. httpx2 builds the body with that boundary, so a file that contains \r\n--++...

X Description: Fixes #1509 Since #1005 every generated multipart/form-data request sets Content-Type: multipart/form-data; boundary=+++. httpx2 builds the body with that boundary, so a file that contains \r\n--++...

Opengraph URL: https://github.com/openapi-generators/openapi-python-client/pull/1511

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.113.4

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:dfb97bfb-35a1-5f93-8cc4-15eea8adf8f4
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idC250:CD79A:33297A4:43A2053:6B036035
html-safe-noncefcdd1ea82e6ea62fbb42b0c5c98a1e82e10b83a25da917b38280e7acab4e8a9f
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMjUwOkNENzlBOjMzMjk3QTQ6NDNBMjA1Mzo2QjAzNjAzNSIsInZpc2l0b3JfaWQiOiI0MjQ3NzAwMjg1MDU0NzM4NDg1IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac47bd7414ad43c512388befc2beeb684731cff9829d96bebf6ac10515945101c2
hovercard-subject-tagpull_request:5205075496
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/openapi-generators/openapi-python-client/pull/1511/files
twitter:imagehttps://avatars.githubusercontent.com/u/94641613?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/94641613?s=400&v=4
og:image:altFixes #1509 Since #1005 every generated multipart/form-data request sets Content-Type: multipart/form-data; boundary=+++. httpx2 builds the body with that boundary, so a file that contains \r\n--++...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/openapi-generators/openapi-python-client git https://github.com/openapi-generators/openapi-python-client.git
octolytics-dimension-user_id84925606
octolytics-dimension-user_loginopenapi-generators
octolytics-dimension-repository_id240776275
octolytics-dimension-repository_nwoopenapi-generators/openapi-python-client
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id240776275
octolytics-dimension-repository_network_root_nwoopenapi-generators/openapi-python-client
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release423dbb54c5e7bfecc838eb387c1435eb3d0e760d
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/openapi-generators/openapi-python-client/pull/1511/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fopenapi-generators%2Fopenapi-python-client%2Fpull%2F1511%2Ffiles
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%2Fopenapi-generators%2Fopenapi-python-client%2Fpull%2F1511%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=openapi-generators%2Fopenapi-python-client
Reloadhttps://github.com/openapi-generators/openapi-python-client/pull/1511/files
Reloadhttps://github.com/openapi-generators/openapi-python-client/pull/1511/files
Reloadhttps://github.com/openapi-generators/openapi-python-client/pull/1511/files
openapi-generatorshttps://github.com/openapi-generators
openapi-python-clienthttps://github.com/openapi-generators/openapi-python-client
Codehttps://github.com/openapi-generators/openapi-python-client
Issues94 (94)https://github.com/openapi-generators/openapi-python-client/issues
Pull requests36 (36)https://github.com/openapi-generators/openapi-python-client/pulls
Discussionshttps://github.com/openapi-generators/openapi-python-client/discussions
Actionshttps://github.com/openapi-generators/openapi-python-client/actions
Security and quality4 (4)https://github.com/openapi-generators/openapi-python-client/security
Insightshttps://github.com/openapi-generators/openapi-python-client/insights
Sign up for GitHub https://github.com/signup?return_to=%2Fopenapi-generators%2Fopenapi-python-client%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fopenapi-generators%2Fopenapi-python-client%2Fissues%2Fnew%2Fchoose
dbantyhttps://github.com/dbanty
openapi-generators:mainhttps://github.com/openapi-generators/openapi-python-client/tree/main
RClaudiuM:fix/1509-random-multipart-boundaryhttps://github.com/RClaudiuM/openapi-python-client/tree/fix/1509-random-multipart-boundary
Conversation 1 https://github.com/openapi-generators/openapi-python-client/pull/1511
Commits 1 https://github.com/openapi-generators/openapi-python-client/pull/1511/commits
Checks 24 https://github.com/openapi-generators/openapi-python-client/pull/1511/checks
Files changed https://github.com/openapi-generators/openapi-python-client/pull/1511/files
Please reload this pagehttps://github.com/openapi-generators/openapi-python-client/pull/1511/files
fix: Let httpx2 choose the multipart/form-data boundary https://github.com/openapi-generators/openapi-python-client/pull/1511/files#top
Show all changes 1 commit https://github.com/openapi-generators/openapi-python-client/pull/1511/files
3711503 fix: Let httpx2 choose the multipart/form-data boundary RClaudiuM Nov 7, 2026 https://github.com/openapi-generators/openapi-python-client/pull/1511/commits/37115037a1a3c4efd37e740ce091a7f6c7781c19
Clear filters https://github.com/openapi-generators/openapi-python-client/pull/1511/files
Please reload this pagehttps://github.com/openapi-generators/openapi-python-client/pull/1511/files
Please reload this pagehttps://github.com/openapi-generators/openapi-python-client/pull/1511/files
let_httpx2_choose_the_multipart_boundary.md https://github.com/openapi-generators/openapi-python-client/pull/1511/files#diff-cff8aea4ad8f1106acce0885f7d4cba066d90415c3bd129edd24a47ac3a88684
test_multipart_bodies.py https://github.com/openapi-generators/openapi-python-client/pull/1511/files#diff-79eb61101d2e7c0360b0f9353cf86647f4a6d6a963e08fe8a81e2e543f15a75c
post_user_list.py https://github.com/openapi-generators/openapi-python-client/pull/1511/files#diff-b99037addaa59985fc1cb0f9a828387bad51ed874ead699d1e33c187cf929361
post_bodies_multiple.py https://github.com/openapi-generators/openapi-python-client/pull/1511/files#diff-7e33faac8b5cc1780d370bfdf02b47e0b761bfdb3e608477ef39af0b75060dc5
upload_file_tests_upload_post.py https://github.com/openapi-generators/openapi-python-client/pull/1511/files#diff-9b1c37dd0b926ef4626133e3c4ea7d05d508af5333c54a5406163aef3b968e7d
post_body_multipart.py https://github.com/openapi-generators/openapi-python-client/pull/1511/files#diff-9cf1b62b700136cedab8c35a1b49897222a84681f9015cc3eab1f6340a1db4b9
endpoint_module.py.jinja https://github.com/openapi-generators/openapi-python-client/pull/1511/files#diff-0de8437b26075d8fe8454cf47d8d95d4835c7f827fa87328e03f690412be803e
.changeset/let_httpx2_choose_the_multipart_boundary.mdhttps://github.com/openapi-generators/openapi-python-client/pull/1511/files#diff-cff8aea4ad8f1106acce0885f7d4cba066d90415c3bd129edd24a47ac3a88684
View file https://github.com/RClaudiuM/openapi-python-client/blob/37115037a1a3c4efd37e740ce091a7f6c7781c19/.changeset/let_httpx2_choose_the_multipart_boundary.md
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/openapi-generators/openapi-python-client/pull/1511/{{ revealButtonHref }}
end_to_end_tests/functional_tests/generated_code_execution/test_multipart_bodies.pyhttps://github.com/openapi-generators/openapi-python-client/pull/1511/files#diff-79eb61101d2e7c0360b0f9353cf86647f4a6d6a963e08fe8a81e2e543f15a75c
View file https://github.com/RClaudiuM/openapi-python-client/blob/37115037a1a3c4efd37e740ce091a7f6c7781c19/end_to_end_tests/functional_tests/generated_code_execution/test_multipart_bodies.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/openapi-generators/openapi-python-client/pull/1511/{{ revealButtonHref }}
...nd_tests/golden-records/my-enum-api-client/my_enum_api_client/api/tests/post_user_list.pyhttps://github.com/openapi-generators/openapi-python-client/pull/1511/files#diff-b99037addaa59985fc1cb0f9a828387bad51ed874ead699d1e33c187cf929361
View file https://github.com/RClaudiuM/openapi-python-client/blob/37115037a1a3c4efd37e740ce091a7f6c7781c19/end_to_end_tests/golden-records/my-enum-api-client/my_enum_api_client/api/tests/post_user_list.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/openapi-generators/openapi-python-client/pull/1511/{{ revealButtonHref }}
https://github.com/openapi-generators/openapi-python-client/pull/1511/files#diff-b99037addaa59985fc1cb0f9a828387bad51ed874ead699d1e33c187cf929361
https://github.com/openapi-generators/openapi-python-client/pull/1511/files#diff-b99037addaa59985fc1cb0f9a828387bad51ed874ead699d1e33c187cf929361
...s/golden-records/my-test-api-client/my_test_api_client/api/bodies/post_bodies_multiple.pyhttps://github.com/openapi-generators/openapi-python-client/pull/1511/files#diff-7e33faac8b5cc1780d370bfdf02b47e0b761bfdb3e608477ef39af0b75060dc5
View file https://github.com/RClaudiuM/openapi-python-client/blob/37115037a1a3c4efd37e740ce091a7f6c7781c19/end_to_end_tests/golden-records/my-test-api-client/my_test_api_client/api/bodies/post_bodies_multiple.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/openapi-generators/openapi-python-client/pull/1511/{{ revealButtonHref }}
https://github.com/openapi-generators/openapi-python-client/pull/1511/files#diff-7e33faac8b5cc1780d370bfdf02b47e0b761bfdb3e608477ef39af0b75060dc5
https://github.com/openapi-generators/openapi-python-client/pull/1511/files#diff-7e33faac8b5cc1780d370bfdf02b47e0b761bfdb3e608477ef39af0b75060dc5
...-records/my-test-api-client/my_test_api_client/api/tests/upload_file_tests_upload_post.pyhttps://github.com/openapi-generators/openapi-python-client/pull/1511/files#diff-9b1c37dd0b926ef4626133e3c4ea7d05d508af5333c54a5406163aef3b968e7d
View file https://github.com/RClaudiuM/openapi-python-client/blob/37115037a1a3c4efd37e740ce091a7f6c7781c19/end_to_end_tests/golden-records/my-test-api-client/my_test_api_client/api/tests/upload_file_tests_upload_post.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/openapi-generators/openapi-python-client/pull/1511/{{ revealButtonHref }}
https://github.com/openapi-generators/openapi-python-client/pull/1511/files#diff-9b1c37dd0b926ef4626133e3c4ea7d05d508af5333c54a5406163aef3b968e7d
https://github.com/openapi-generators/openapi-python-client/pull/1511/files#diff-9b1c37dd0b926ef4626133e3c4ea7d05d508af5333c54a5406163aef3b968e7d
integration-tests/integration_tests/api/body/post_body_multipart.pyhttps://github.com/openapi-generators/openapi-python-client/pull/1511/files#diff-9cf1b62b700136cedab8c35a1b49897222a84681f9015cc3eab1f6340a1db4b9
View file https://github.com/RClaudiuM/openapi-python-client/blob/37115037a1a3c4efd37e740ce091a7f6c7781c19/integration-tests/integration_tests/api/body/post_body_multipart.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/openapi-generators/openapi-python-client/pull/1511/{{ revealButtonHref }}
https://github.com/openapi-generators/openapi-python-client/pull/1511/files#diff-9cf1b62b700136cedab8c35a1b49897222a84681f9015cc3eab1f6340a1db4b9
https://github.com/openapi-generators/openapi-python-client/pull/1511/files#diff-9cf1b62b700136cedab8c35a1b49897222a84681f9015cc3eab1f6340a1db4b9
openapi_python_client/templates/endpoint_module.py.jinjahttps://github.com/openapi-generators/openapi-python-client/pull/1511/files#diff-0de8437b26075d8fe8454cf47d8d95d4835c7f827fa87328e03f690412be803e
View file https://github.com/RClaudiuM/openapi-python-client/blob/37115037a1a3c4efd37e740ce091a7f6c7781c19/openapi_python_client/templates/endpoint_module.py.jinja
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/openapi-generators/openapi-python-client/pull/1511/{{ revealButtonHref }}
https://github.com/openapi-generators/openapi-python-client/pull/1511/files#diff-0de8437b26075d8fe8454cf47d8d95d4835c7f827fa87328e03f690412be803e
https://github.com/openapi-generators/openapi-python-client/pull/1511/files#diff-0de8437b26075d8fe8454cf47d8d95d4835c7f827fa87328e03f690412be803e
Please reload this pagehttps://github.com/openapi-generators/openapi-python-client/pull/1511/files
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

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlno-cache

Viewport: width=device-width


URLs of crawlers that visited me.