[PR #128] [MERGED] fix: send Markdown uploads as text/markdown #123

Closed
opened 2026-10-18 21:14:32 +00:00 by bsakaguchi · 0 comments
Owner

📋 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)

  • 191fae4 fix: 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.

## 📋 Pull Request Information **Original PR:** https://github.com/open-webui/oikb/pull/128 **Author:** [@djlongy](https://github.com/djlongy) **Created:** 9/23/2026 **Status:** ✅ Merged **Merged:** 10/10/2026 **Merged by:** [@tjbck](https://github.com/tjbck) **Base:** `main` ← **Head:** `fix/markdown-upload-content-type` --- ### 📝 Commits (1) - [`191fae4`](https://github.com/open-webui/oikb/commit/191fae4afb2ed2f6b7e4d9c1a28a05f43458dfad) fix: send Markdown uploads as text/markdown ### 📊 Changes **2 files changed** (+25 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `src/oikb/client.py` (+14 -1) 📝 `tests/test_kb_sync.py` (+11 -0) </details> ### 📄 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 <br> 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. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-18 21:14:32 +00:00
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
open-webui/oikb#123
No description provided.