Repository navigation
feat(catalog): add WithHeaders function - #652
Conversation
d173ebd to
3660d0d
Compare
zeroshade
left a comment
There was a problem hiding this comment.
Can you also add a test that expects the custom headers on the fetchAccessToken routes where it fetches credentials?
|
@zeroshade added the tests and addressed the comments, ptal! |
|
@rambleraptor can you please fix the lint issues? |
5c87d2d to
1b15b28
Compare
|
I (very dumbly) overwrote the test changes when I rebased. I rewrote the test to the best of my memory (and it still passes!) so hopefully nothing important is lost there. CI is passing! |
kevinjqliu
left a comment
There was a problem hiding this comment.
LGTM! one minor nit comment
|
@zeroshade @kevinjqliu changes made, and I undid my Git screwup. Thanks for the review! |
|
|
||
| session.defaultHeaders.Set("X-Client-Version", icebergRestSpecVersion) | ||
| session.defaultHeaders.Set("Content-Type", "application/json") | ||
| session.defaultHeaders.Set("User-Agent", "GoIceberg/"+iceberg.Version()) |
There was a problem hiding this comment.
Is it desirable to be able to override this as well?
There was a problem hiding this comment.
yea good point. for python, we allow overriding X-Iceberg-Access-Delegation but not User-Agent and Content-Type.
There was a problem hiding this comment.
the order currently would not allow User-Agent to be overridden. I think thats the right behavior
|
|
||
| session.defaultHeaders.Set("X-Client-Version", icebergRestSpecVersion) | ||
| session.defaultHeaders.Set("Content-Type", "application/json") | ||
| session.defaultHeaders.Set("User-Agent", "GoIceberg/"+iceberg.Version()) |
There was a problem hiding this comment.
yea good point. for python, we allow overriding X-Iceberg-Access-Delegation but not User-Agent and Content-Type.
|
|
||
| session.defaultHeaders.Set("X-Client-Version", icebergRestSpecVersion) | ||
| session.defaultHeaders.Set("Content-Type", "application/json") | ||
| session.defaultHeaders.Set("User-Agent", "GoIceberg/"+iceberg.Version()) |
There was a problem hiding this comment.
the order currently would not allow User-Agent to be overridden. I think thats the right behavior
|
Thanks for the PR @rambleraptor and thank you @zeroshade @ferhatelmas for the review |
|
I had put a comment #652 (comment) but it seems it is missed. Please confirm me wrong, otherwise we might want to address it |
|
Put #673 to show the issue |
related to #652 Signed-off-by: ferhat elmas <[email protected]>
|
I did miss that comment, thanks for following up @ferhatelmas 😄 |
Closes #532
This adds support for sending custom headers for IRC requests.
I'm happy to add a
WithClientfunction as well (for sending a custom HTTP client), but it's unclear when the custom client would be used versus the options the user has sent.