Skip to content

fix: Knowledge base zip upload file authorization error - #6507

Merged
shaohuzhang1 merged 1 commit into
v2from
pr@v2@fix_zip_upload
Jul 24, 2026
Merged

fix: Knowledge base zip upload file authorization error#6507
shaohuzhang1 merged 1 commit into
v2from
pr@v2@fix_zip_upload

Conversation

@shaohuzhang1

Copy link
Copy Markdown
Contributor

fix: Knowledge base zip upload file authorization error

Copilot AI review requested due to automatic review settings July 24, 2026 05:00
@shaohuzhang1

Copy link
Copy Markdown
Contributor Author

Seems you are using me but didn't get OPENAI_API_KEY seted in Variables/Secrets for this repo. you could follow readme for more information

@shaohuzhang1
shaohuzhang1 merged commit 5084a37 into v2 Jul 24, 2026
5 of 7 checks passed
@shaohuzhang1
shaohuzhang1 deleted the pr@v2@fix_zip_upload branch July 24, 2026 05:01

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adjusts how embedded oss/file/* and oss/image/* references inside ZIP-imported markdown/HTML content are handled, aiming to prevent authorization failures by rewriting those references to newly created File IDs during ZIP processing.

Changes:

  • When a ZIP entry path starts with oss/file/ or oss/image/, the handler now generates a new file ID and rewrites the paragraph content to reference ./oss/file/<new_id>.
  • The collected file_list entries for these references now use the newly generated ID (instead of preserving an existing UUID from the ZIP path).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 91 to 98
if file_path.startswith("oss/file/") or file_path.startswith("oss/image/"):
file_id = file_path.replace("oss/file/", "").replace("oss/image/", "")
if is_valid_uuid(file_id):
file_list.append({"source_file": file_path, "image_id": file_id})
file_list.append({"source_file": file_path, "image_id": new_id})
content = update_content(content, source_path, f"./oss/file/{new_id}")
else:
file_list.append({"source_file": file_path, "image_id": new_id})
content = update_content(content, source_path, f"./oss/file/{new_id}")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants