You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2021/08/16 06:49:40 UTC

[GitHub] [pulsar] eolivelli commented on a change in pull request #11666: [pulsar-admin] allow create functions with package URL

eolivelli commented on a change in pull request #11666:
URL: https://github.com/apache/pulsar/pull/11666#discussion_r689277408



##########
File path: pulsar-common/src/main/java/org/apache/pulsar/common/functions/Utils.java
##########
@@ -34,7 +36,9 @@
 
     public static boolean isFunctionPackageUrlSupported(String functionPkgUrl) {
         return isNotBlank(functionPkgUrl) && (functionPkgUrl.startsWith(HTTP)
-                || functionPkgUrl.startsWith(FILE));
+                || functionPkgUrl.startsWith(FILE)
+                || Arrays.stream(PackageType.values()).anyMatch(type -> functionPkgUrl.startsWith(type.toString()))

Review comment:
       can we create an utility method ? this code looks duplicated




-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org