Skip to content

Commit 60e9916

Browse files
committed
fix: raise exception for file size limit exceeded
1 parent ecdf558 commit 60e9916

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

apps/oss/serializers/file.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ def get_url_content(url, application_id: str):
187187
raise ValueError("Blocked unsafe redirect to internal host")
188188
# 判断文件大小
189189
if int(response.headers.get('Content-Length', 0)) > file_limit:
190-
return AppApiException(500, _('File size exceeds limit'))
190+
raise AppApiException(500, _('File size exceeds limit'))
191191
# 返回状态码 响应内容大小 响应的contenttype 还有字节流
192192
content_type = response.headers.get('Content-Type', '')
193193
# 根据内容类型决定如何处理

0 commit comments

Comments
 (0)