plusplusjiajia commented on code in PR #2660:
URL: https://github.com/apache/iceberg-rust/pull/2660#discussion_r3868986460


##########
crates/catalog/rest/src/auth/oauth2.rs:
##########
@@ -219,7 +219,11 @@ fn attach_bearer(req: &mut HttpRequest, token: 
&SensitiveString) -> Result<()> {
             .with_source(e)
         })?;
     value.set_sensitive(true);
-    req.headers_mut().insert(http::header::AUTHORIZATION, value);
+    // Java's `OAuth2Util.AuthSession` puts the header only if absent, leaving 
a
+    // configured `header.authorization` in place.
+    if !req.headers().contains_key(http::header::AUTHORIZATION) {
+        req.headers_mut().insert(http::header::AUTHORIZATION, value);
+    }

Review Comment:
   @CTTY Happy to split if you'd prefer, though neither this nor the reordering 
it goes with is observable on its own — I reverted both and only the SigV4 test 
fails; for an OAuth2 or Noop session a configured header.authorization wins 
either way. They only matter once a session needs the final header set.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to