Skip to content

fix(catalog): handle content-type header correctly for fetchToken - #673

Merged
zeroshade merged 1 commit into
apache:mainfrom
ferhatelmas:fetch-token-content-type
Jan 9, 2026
Merged

zeroshade merged 1 commit into
apache:mainfrom
ferhatelmas:fetch-token-content-type

Conversation

@ferhatelmas

Copy link
Copy Markdown
Contributor

related to #652

@zeroshade zeroshade left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the quick turnaround on this!

@zeroshade
zeroshade merged commit 4390ffe into apache:main Jan 9, 2026
11 checks passed
@ferhatelmas
ferhatelmas deleted the fetch-token-content-type branch January 9, 2026 21:09
Comment thread catalog/rest/rest.go
Comment on lines +212 to +214
// Skip Content-Type if it's already set in the request
// to avoid duplicate headers (e.g., when using PostForm)
if http.CanonicalHeaderKey(k) == "Content-Type" && r.Header.Get("Content-Type") != "" {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could we have also optionally set Content-Type in createSession? Similar to X-Iceberg-Access-Delegation

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not the same case because we want it in default headers unconditionally but not in fetch token which sets directly to a different value (application/x-www-form-urlencoded). Even if it's set there optionally, it wouldn't prevent duplication

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.

3 participants