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 2022/12/28 01:12:04 UTC

[GitHub] [pulsar] mattisonchao commented on a diff in pull request #18995: [fix][broker] forbid uploading BYTES schema with admin API

mattisonchao commented on code in PR #18995:
URL: https://github.com/apache/pulsar/pull/18995#discussion_r1058001023


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/SchemasResourceBase.java:
##########
@@ -114,6 +114,10 @@ public CompletableFuture<SchemaVersion> deleteSchemaAsync(boolean authoritative,
     }
 
     public CompletableFuture<SchemaVersion> postSchemaAsync(PostSchemaPayload payload, boolean authoritative) {
+        if (SchemaType.BYTES.name().equals(payload.getType())) {
+            throw new RestException(Response.Status.NOT_ACCEPTABLE,

Review Comment:
   Please return failed future to avoid additional` try-catch` when invoke this method.



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