소스 검색

fix: add status_code 304 (#6000)

Co-authored-by: crazywoola <100913391+crazywoola@users.noreply.github.com>
Co-authored-by: crazywoola <427733928@qq.com>
opriuwohg 9 달 전
부모
커밋
af98fd29bf
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      api/core/file/message_file_parser.py

+ 1 - 1
api/core/file/message_file_parser.py

@@ -186,7 +186,7 @@ class MessageFileParser:
             }
             }
 
 
             response = requests.head(url, headers=headers, allow_redirects=True)
             response = requests.head(url, headers=headers, allow_redirects=True)
-            if response.status_code == 200:
+            if response.status_code in {200, 304}:
                 return True, ""
                 return True, ""
             else:
             else:
                 return False, "URL does not exist."
                 return False, "URL does not exist."