Skip to content

Commit 9601102

Browse files
authored
fix(word_extractor): Fix type error and remove stream in ssrf_proxy (#11241)
Signed-off-by: -LAN- <[email protected]>
1 parent 56c2d1c commit 9601102

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

api/core/helper/ssrf_proxy.py

-2
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,6 @@ def make_request(method, url, max_retries=SSRF_DEFAULT_MAX_RETRIES, **kwargs):
5353
response = client.request(method=method, url=url, **kwargs)
5454

5555
if response.status_code not in STATUS_FORCELIST:
56-
if stream:
57-
return response.iter_bytes()
5856
return response
5957
else:
6058
logging.warning(f"Received status code {response.status_code} for URL {url} which is in the force list")

api/core/rag/extractor/word_extractor.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def _extract_images_from_docx(self, doc, image_folder):
8686
image_count += 1
8787
if rel.is_external:
8888
url = rel.reltype
89-
response = ssrf_proxy.get(url, stream=True)
89+
response = ssrf_proxy.get(url)
9090
if response.status_code == 200:
9191
image_ext = mimetypes.guess_extension(response.headers["Content-Type"])
9292
file_uuid = str(uuid.uuid4())

0 commit comments

Comments
 (0)