wgtmac commented on code in PR #544:
URL: https://github.com/apache/iceberg-cpp/pull/544#discussion_r2793532371
##########
src/iceberg/catalog/rest/http_client.cc:
##########
@@ -67,19 +68,17 @@ namespace {
/// \brief Default error type for unparseable REST responses.
constexpr std::string_view kRestExceptionType = "RESTException";
-/// \brief Merges global default headers with request-specific headers.
-///
-/// Combines the global headers derived from RestCatalogProperties with the
headers
-/// passed in the specific request. Request-specific headers have higher
priority
-/// and will override global defaults if the keys conflict (e.g., overriding
-/// the default "Content-Type").
-cpr::Header MergeHeaders(const std::unordered_map<std::string, std::string>&
defaults,
- const std::unordered_map<std::string, std::string>&
overrides) {
- cpr::Header combined_headers = {defaults.begin(), defaults.end()};
- for (const auto& [key, val] : overrides) {
- combined_headers.insert_or_assign(key, val);
+/// \brief Prepare headers for an HTTP request.
+Result<cpr::Header> BuildHeaders(
+ const std::unordered_map<std::string, std::string>& request_headers,
+ const std::unordered_map<std::string, std::string>& default_headers,
+ auth::AuthSession& session) {
+ std::unordered_map<std::string, std::string> headers(request_headers);
+ for (const auto& [key, val] : default_headers) {
Review Comment:
```suggestion
std::unordered_map<std::string, std::string> headers(default_headers);
for (const auto& [key, val] : request_headers) {
```
--
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]