From af98fd29bf5ff4536a5772bd5023625cbdf5f194 Mon Sep 17 00:00:00 2001 From: opriuwohg Date: Fri, 5 Jul 2024 21:10:33 +0800 Subject: [PATCH] fix: add status_code 304 (#6000) Co-authored-by: crazywoola <100913391+crazywoola@users.noreply.github.com> Co-authored-by: crazywoola <427733928@qq.com> --- api/core/file/message_file_parser.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/core/file/message_file_parser.py b/api/core/file/message_file_parser.py index 52498eb871..842b539ad1 100644 --- a/api/core/file/message_file_parser.py +++ b/api/core/file/message_file_parser.py @@ -186,7 +186,7 @@ class MessageFileParser: } response = requests.head(url, headers=headers, allow_redirects=True) - if response.status_code == 200: + if response.status_code in {200, 304}: return True, "" else: return False, "URL does not exist."