pulsar-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] jai1 commented on a change in pull request #884: Restrict partitioned-metadata rest-api access for cpp-client older than 1.21
Date Thu, 01 Jan 1970 00:00:00 GMT
jai1 commented on a change in pull request #884: Restrict partitioned-metadata rest-api access
for cpp-client older than 1.21
URL: https://github.com/apache/incubator-pulsar/pull/884#discussion_r151802742
 
 

 ##########
 File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/PersistentTopics.java
 ##########
 @@ -1500,11 +1492,13 @@ private void validateClientVersion() {
                 if (splits != null && splits.length > 1) {
                     if (LEAST_SUPPORTED_CLIENT_VERSION_PREFIX.getMajorVersion() > Integer.parseInt(splits[0])
                             || LEAST_SUPPORTED_CLIENT_VERSION_PREFIX.getMinorVersion() >
Integer.parseInt(splits[1])) {
-                        throw new UnsupportedOperationException("version " + userAgent +
" is not supported");
+                        throw new RestException(Status.METHOD_NOT_ALLOWED,
+                                "Client lib is not compatible to access partitioned metadata:
version " + userAgent
+                                        + " is not supported");
                     }
                 }
-            } catch (UnsupportedOperationException ue) {
-                throw ue;
+            } catch (RestException re) {
+                throw re;
             } catch (Exception e) {
 
 Review comment:
   If validate client version is on and you can't parse the client version - shouldn't we
disallow the request? I mean just convert the Exception to a RestException and throw it.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message