timothyw553 commented on code in PR #18878:
URL: https://github.com/apache/iceberg/pull/18878#discussion_r4723356909


##########
core/src/main/java/org/apache/iceberg/rest/HTTPClient.java:
##########
@@ -169,6 +170,33 @@ public HTTPClient withAuthSession(AuthSession session) {
     return new HTTPClient(this, session);
   }
 
+  @VisibleForTesting
+  static String userAgent(String override, String prefix) {
+    if (override != null) {
+      // the HTTP client silently replaces characters outside visible ASCII 
with '?'
+      Preconditions.checkArgument(

Review Comment:
   why are we validating `override` here? values like `café/1` or tabs worked 
before, so rejecting them now could break existing catalogs on startup 
(including via server-returned config). could we preserve the existing override 
behavior and also drop the ASCII note from `rest-catalog.md` and the PR 
description?
   
   ```diff
    if (override != null) {
   -  // the HTTP client silently replaces characters outside visible ASCII 
with '?'
   -  Preconditions.checkArgument(
   -      override.chars().allMatch(c -> c >= 0x20 && c <= 0x7E),
   -      "Invalid %s: only visible ASCII characters and spaces are allowed",
   -      REST_USER_AGENT);
      return override;
    }
   ```



-- 
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