Skip to content

fix: handle sendFile misses over http#20

Merged
cs50victor merged 2 commits intomainfrom
fix/stderr_handling
Apr 9, 2026
Merged

fix: handle sendFile misses over http#20
cs50victor merged 2 commits intomainfrom
fix/stderr_handling

Conversation

@cs50victor
Copy link
Copy Markdown
Collaborator

Summary

  • add a shared sendFile error classifier so file-serving misses return explicit HTTP responses instead of falling through to Express default error handling
  • route the oo-editors sendFile endpoints through that helper, including media, converted files, desktop stub assets, wasm redirects, fonts, and the service worker
  • add unit coverage for the sendFile error classification helper

Why

Handled file misses should produce stable HTTP 404/500 responses without printing default Express stack traces to stderr. This keeps request-level file misses as HTTP behavior instead of process-level error noise.

Verification

  • bun test tests/server-utils.test.js
  • node --check server.js
  • node --check server-utils.js

@cs50victor cs50victor merged commit 8814f4d into main Apr 9, 2026
4 checks passed
@cs50victor cs50victor deleted the fix/stderr_handling branch April 9, 2026 16:56
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.

1 participant