dramaticlly commented on code in PR #13712:
URL: https://github.com/apache/iceberg/pull/13712#discussion_r2244488424
##########
core/src/test/java/org/apache/iceberg/rest/RESTCatalogAdapter.java:
##########
@@ -287,7 +288,23 @@ public RESTClient withAuthSession(AuthSession session) {
@SuppressWarnings({"MethodLength", "checkstyle:CyclomaticComplexity"})
public <T extends RESTResponse> T handleRequest(
- Route route, Map<String, String> vars, Object body, Class<T>
responseType) {
+ Route route,
+ Map<String, String> vars,
+ HTTPRequest httpRequest,
+ Class<T> responseType,
+ Consumer<Map<String, String>> responseHeaders) {
+ Object body = httpRequest.body();
+
+ if (responseHeaders != null) {
+ responseHeaders.accept(ImmutableMap.of("X-Request-Id",
String.valueOf(System.nanoTime())));
+
+ // Set route specific response headers
+ switch (route) {
+ case CONFIG:
+ responseHeaders.accept(ImmutableMap.of("X-Iceberg-Version",
IcebergBuild.version()));
+ }
Review Comment:
I realize this is public class in test package and shared by in many tests,
want to leverage to ensure we cover the basic test of response header. Please
let me know if there's better place to set response headers before features
like idempotent etag is implemented.
--
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]