mirror of
https://github.com/open-webui/oikb.git
synced 2026-11-05 01:27:25 +00:00
[PR #128] [MERGED] fix: send Markdown uploads as text/markdown #123
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
open-webui/oikb#123
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/open-webui/oikb/pull/128
Author: @djlongy
Created: 9/23/2026
Status: ✅ Merged
Merged: 10/10/2026
Merged by: @tjbck
Base:
main← Head:fix/markdown-upload-content-type📝 Commits (1)
191fae4fix: send Markdown uploads as text/markdown📊 Changes
2 files changed (+25 additions, -1 deletions)
View changed files
📝
src/oikb/client.py(+14 -1)📝
tests/test_kb_sync.py(+11 -0)📄 Description
The published image runs Python 3.11 on a slim base with no /etc/mime.types, and 3.11's mimetypes table has no entry for .md. upload_file passes no content type, so httpx sends every Markdown file as application/octet-stream. Open WebUI reads an upload as plain text only when the type is text/* (or the extension is a known source extension, which md is not), so with Docling or Tika configured as the extraction engine each .md went through that engine and was stored as its re-rendered output. With Docling, GFM tables containing inline code or
came back split, with rows lost.
upload_file now falls back to text/markdown for .md and .markdown when mimetypes has no answer.
Tested with the suite on Python 3.11 (new test fails before, 40 pass after) and end to end: an image built from this branch synced 7 Markdown files into Open WebUI 0.11.4 with Docling enabled, 0 Docling calls, stored content byte-identical to the source.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.