File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -173,8 +173,8 @@ def get_url_content(url, application_id: str):
173173 if not application .file_upload_enable :
174174 return AppApiException (500 , _ ('File upload is not enabled' ))
175175 file_limit = 50 * 1024 * 1024
176- if application .file_upload_setting and application .file_upload_setting .file_limit :
177- file_limit = application .file_upload_setting .file_limit * 1024 * 1024
176+ if application .file_upload_setting and application .file_upload_setting .get ( 'fileLimit' ) :
177+ file_limit = application .file_upload_setting .get ( 'fileLimit' ) * 1024 * 1024
178178 parsed = validate_url (url )
179179
180180 response = requests .get (
@@ -186,7 +186,7 @@ def get_url_content(url, application_id: str):
186186 if is_private_ip (final_host ):
187187 raise ValueError ("Blocked unsafe redirect to internal host" )
188188 # 判断文件大小
189- if response .headers .get ('Content-Length' , 0 ) > file_limit :
189+ if int ( response .headers .get ('Content-Length' , 0 ) ) > file_limit :
190190 return AppApiException (500 , _ ('File size exceeds limit' ))
191191 # 返回状态码 响应内容大小 响应的contenttype 还有字节流
192192 content_type = response .headers .get ('Content-Type' , '' )
You can’t perform that action at this time.
0 commit comments