Serve images as static files via /images/ route#19
Draft
Copilot wants to merge 2 commits into
Draft
Conversation
…l in keyframes load
Copilot
AI
changed the title
[WIP] Load images directly from folder instead of API calls
Serve images as static files via /images/ route
Jun 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Images were served through an API handler (
/api/image/<filename>) that added Python overhead on every request, usedsend_filewith a manually-constructed path (path traversal risk), and required manual MIME type detection.Changes
vest/app.py/images/<path:filename>route replaces/api/image/— delegates directly tosend_from_directory(app.image_base_path, filename), which enforces directory confinement, handles MIME types automatically, and enables proper HTTP caching semantics/api/keyframes/load— user-suppliedfilenamewas passed directly toos.path.join(cwd, filename); replaced with a glob-based lookup so the file path is never constructed from user inputvest/static/viewer.js`/api/image/${filename}`→`/images/${filename}`tests/test_app.py(new)/images/route: no base path, successful serve, missing file, and path traversal rejectionDEVELOPMENT.mdGET /api/image/<filename>toGET /images/<filename>