mirror of
https://github.com/open-webui/open-webui.git
synced 2026-10-28 06:22:33 +00:00
fix: MinerU local mode fails every document on a 4.x server that requires an API key (#32838)
A self-hosted MinerU 4.x server started with an API key rejected every document with a 401, even with the key filled in under Documents settings, because local mode never sent it. The key is now sent with the document requests to a 4.x server whenever one is set. Servers without a key are unaffected. Fixes #32836
This commit is contained in:
parent
6367a3cc40
commit
3e0564d11a
1 changed files with 5 additions and 1 deletions
|
|
@ -273,8 +273,12 @@ class MinerULoader:
|
|||
"""
|
||||
Send one request to the MinerU V1 API and raise an HTTPException on failure.
|
||||
"""
|
||||
# A 4.x server started with --api-key rejects every V1 request without it
|
||||
headers = {'Authorization': f'Bearer {self.api_key}'} if self.api_key else None
|
||||
try:
|
||||
response = requests.request(method, f'{self.api_url}{path}', timeout=self.timeout, **kwargs)
|
||||
response = requests.request(
|
||||
method, f'{self.api_url}{path}', headers=headers, timeout=self.timeout, **kwargs
|
||||
)
|
||||
response.raise_for_status()
|
||||
except requests.Timeout:
|
||||
raise HTTPException(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue