clintropolis commented on a change in pull request #11711:
URL: https://github.com/apache/druid/pull/11711#discussion_r713631100



##########
File path: 
server/src/main/java/org/apache/druid/server/initialization/ServerConfig.java
##########
@@ -61,7 +63,9 @@ public ServerConfig(
       int inflateBufferSize,
       int compressionLevel,
       boolean enableForwardedRequestCustomizer,
-      @NotNull List<String> allowedHttpMethods
+      @NotNull List<String> allowedHttpMethods,
+      boolean sanitizeJettyErrorResponse,

Review comment:
       I think these configs should be called `enableErrorResponseTransform` 
and `errorResponseTransformStrategy` respectively, or something similar, since 
it is clearer their purpose (and also `ErrorResponseTransformStrategy` is the 
type name)

##########
File path: 
core/src/main/java/org/apache/druid/common/exception/SanitizableException.java
##########
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.druid.common.exception;
+
+import java.util.function.Function;
+
+public interface SanitizableException
+{
+  /**
+   * Apply the function for transforming the error message then
+   * return new Exception with sanitized fields and transformed message.
+   */
+  Exception transform(

Review comment:
       heh oops, was my suggestion to rename `transform`, but I guess I also 
suggested renaming `SanitizableException` to something else, though I feel less 
strongly about the name of this than the property name in the config, (which I 
think should be `druid.server.http.enableErrorResponseTransform` and 
`druid.server.http.errorResponseTransformStrategy`)

##########
File path: 
server/src/main/java/org/apache/druid/server/initialization/ServerConfig.java
##########
@@ -235,14 +257,15 @@ public boolean equals(Object o)
            queueSize == that.queueSize &&
            enableRequestLimit == that.enableRequestLimit &&
            defaultQueryTimeout == that.defaultQueryTimeout &&
-           maxScatterGatherBytes.equals(that.maxScatterGatherBytes) &&
            maxSubqueryRows == that.maxSubqueryRows &&
            maxQueryTimeout == that.maxQueryTimeout &&
            maxRequestHeaderSize == that.maxRequestHeaderSize &&
            inflateBufferSize == that.inflateBufferSize &&
            compressionLevel == that.compressionLevel &&
            enableForwardedRequestCustomizer == 
that.enableForwardedRequestCustomizer &&
+           sanitizeJettyErrorResponse == that.sanitizeJettyErrorResponse &&

Review comment:
       yeah, I guess you would need to deserialize into strings and keep them 
around alongside a set of patterns to build (which might be worth doing?)




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