Skip to content

Conversation

@curtisr7
Copy link
Contributor

This change shouldn't really be necessary..... but I just spent the better part of an afternoon tracking it down.

I've been testing against snowflake opencatalog and it appears that they're running some older version of polaris where a bug exists where if you specify a Content-Type header multiple times on a POST you'll get a cryptic 400 back from the server. I wasn't able to find a bug in apache/polaris, but the problem doesn't happen on main.

Seems safe to do as the header is defaulted here.

iceberg-go/rgc % curl -X GET -H "Authorization: Bearer xxx" \ 
        -H 'Accept: application/json' \
        -H 'Accept: application/json' \
        -H 'Content-Type: application/json' \
        -H 'Content-Type: application/json' \
        https:/*******.snowflakecomputing.com/polaris/api/catalog/v1/test-catalog/namespaces
{
"servlet":"com.sun.jersey.spi.container.servlet.ServletContainer-16626b18",
"message":"Bad Request",
"url":"/polaris/api/catalog/v1/test-catalog/namespaces",
"status":"400"

Copy link
Member

@zeroshade zeroshade left a comment

Choose a reason for hiding this comment

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

Well, that's annoying, but makes sense. LGTM

@zeroshade zeroshade merged commit 4b645d6 into apache:main Jan 23, 2025
10 checks passed
@zeroshade zeroshade changed the title Do not set Content-type header in doPost fix(catalog/rest): Do not set Content-type header in doPost Jan 23, 2025
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