Skip to content

Only add Content-Type if not already present in the headers#89

Merged
samansmink merged 1 commit intoduckdb:mainfrom
Tmonster:only_add_content_type_if_not_already_added
Jul 23, 2025
Merged

Only add Content-Type if not already present in the headers#89
samansmink merged 1 commit intoduckdb:mainfrom
Tmonster:only_add_content_type_if_not_already_added

Conversation

@Tmonster
Copy link
Contributor

@Tmonster Tmonster commented Jul 21, 2025

Otherwise we can add to headers of "Content-Type". Some servers may prefer the last seen value, and if it doesn't match the content type for the url, the server may return an error.
This is happening currently with the cloudflare R2 iceberg catalog. The Iceberg client adds the header Content-Type: application/json then httpfs adds Content-Type: application/octet-stream and Cloudflare responds with
"Expected request with Content-Type: application/json"

@samansmink samansmink merged commit 6f22256 into duckdb:main Jul 23, 2025
23 checks passed
Mytherin added a commit to duckdb/duckdb that referenced this pull request Jul 24, 2025
Includes commit to not add an extra header to post requests
duckdb/duckdb-httpfs#89
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants