Extend `/docx` downloads to `/file` for arbitrary file types

⛔ closed · #303 · open-legal-products/mike ← tritium-legal/mike · opened 2mo ago by drewmiller · closed 2mo ago · +263-45 across 5 files · ↗ on GitHub

From the PR description

Summary

This extends the existing /docx endpoint to allow for download of arbitrary files, not just DOCX. It consolidates the old /docx endpoint with a new /file endpoint and redirects the former there.

It's just a suggestion to allow other folks to extend it as we have.

Why / Motivation

Folks implementing in-browser editors and document viewers for the miscellaneous supported formats will want access to the raw file bytes as opposed to the results supplied by /display.

Changes

As above.

Tradeoffs & risks

The very minor trade-off is that folks who want to avoid the imperceptible redirect from /docx to /file will need to migrate. Then the /docx endpoint could be deprecated in favor of the more general /file.

How verified

We ran the test suite, which was unaffected by the changes.

Checklist

  • Ran the relevant build/test command for the area changed.
  • Reviewed git diff and removed unrelated changes.
  • Updated docs / env examples if setup, config, or behavior changed.
  • No secrets, API keys, real documents, or .env files committed.

Our analysis

Generalize raw file downloads — read the full analysis →

Think the analysis missed something the PR description covers?

Commits in this PR (2)

SHA Subject Author Date
a0dcc4e0 add raw File bytes streaming to API Drew Miller 2026-08-07 ↗ GitHub
55afeef3 consolidate file getter endpoints Drew Miller 2026-08-10 ↗ GitHub

Capture this PR into my fork

Download a Markdown prompt that tells Claude how to port every commit in this PR into your working tree. Run it via claude -p < capture-pull-303.md from inside the repo you want the changes in.

⬇ Download capture-pull-303.md