Skip to content

Commit

Permalink
[Fix] Modify the isPythonFileType parameter (#3176)
Browse files Browse the repository at this point in the history
  • Loading branch information
ChengJie1053 authored Sep 24, 2023
1 parent d2a10d6 commit 16d39f9
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 16d39f9

Please sign in to comment.