Skip to content

fix(static): stop static handler after validation failures - #157

Open
codxbrexx wants to merge 3 commits into
metacall:masterfrom
codxbrexx:fix/static
Open

fix(static): stop static handler after validation failures#157
codxbrexx wants to merge 3 commits into
metacall:masterfrom
codxbrexx:fix/static

Conversation

@codxbrexx

Copy link
Copy Markdown
Contributor

Summary

This PR fixes a control-flow bug in src/controller/static.ts.

The static handler already forwarded validation failures with next(...), but it did not stop execution. Because of that, the request could still continue to sendFile(...) after entering the error path.

This change makes the handler return immediately on validation failure and fixes the undeployed-app message so it shows the real application suffix.

Problem statement

The static route should do one of two things:

  • return an error when the app is not deployed or the file does not exist
  • serve the file when validation passes

Before the fix, it could do both paths in the same request because the error branches were missing return.

What changed

  • added early returns for undeployed-app validation failures
  • added early returns for missing-file validation failures
  • corrected the undeployed-app error message to include the actual suffix
  • verified route behavior with tests for failure and success paths

Tests Screensort

image

Type of change

  • Bug fix
  • New feature
  • Documentation
  • Chore / CI
  • Breaking change

Checklist

  • I have read the contributing guidelines
  • I verified the fix with tests
  • I verified existing tests still pass
  • I updated documentation if necessary

Release notes

Fixed the static file route so failed validation exits immediately instead of falling through to sendFile(...).

Stop the static controller after validation failures so it does not
continue into sendFile after entering the error path. Also fixes the
undeployed-app error message to include the real application suffix
and adds route-level regression tests.
@viferga

viferga commented Aug 3, 2026

Copy link
Copy Markdown
Member

Can you merge master into this so we validate it works?

@codxbrexx

Copy link
Copy Markdown
Contributor Author

Can you merge master into this so we validate it works?

merged latest master.

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.

2 participants