From 16d39f931ecb23de14dbcaf30b8f73e64102c6da Mon Sep 17 00:00:00 2001 From: ChengJie1053 <18033291053@163.com> Date: Sun, 24 Sep 2023 14:24:27 +0800 Subject: [PATCH] [Fix] Modify the isPythonFileType parameter (#3176) --- .../console/base/interceptor/UploadFileTypeInterceptor.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/base/interceptor/UploadFileTypeInterceptor.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/base/interceptor/UploadFileTypeInterceptor.java index b4a0483c2e..e575c78241 100644 --- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/base/interceptor/UploadFileTypeInterceptor.java +++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/base/interceptor/UploadFileTypeInterceptor.java @@ -75,8 +75,8 @@ private boolean isPythonFileType(String contentType, InputStream input) { try { Metadata metadata = new Metadata(); AutoDetectParser parser = new AutoDetectParser(); - parser.parse(stream, new DefaultHandler(), metadata, new ParseContext()); - String mimeType = metadata.get(HttpHeaders.CONTENT_TYPE); + parser.parse(input, new DefaultHandler(), metadata, new ParseContext()); + String mimeType = metadata.get(HttpHeaders.CONTENT_TYPE); return contentType.contains("text/x-python") && MediaType.TEXT_PLAIN.toString().equals(mimeType); } catch (Exception e) {