Commit Graph

2 Commits

Author SHA1 Message Date
Michał Gołębiowski-Owczarek
be4f9eccde
Build: Make middleware-mockserver not crash on reading nonexistent files
`fs.readFileSync` crashes when a non-existing file is passed to it. Some APIs
of `middleware-mockserver` read a file the path of which depends on query
parameters, making it possible to crash it by providing such a parameter. The
old PHP server doesn't have these issues.

To fix this, wrap all `fs.readFileSync` occurrences with a function that falls
back to the string `"ERROR"`.

Closes gh-5579

(cherry picked from commit d5ebb464de)
2024-11-05 22:59:55 +01:00
Timmy Willison
b4ab47afd7 Tests: replace express with basic Node server
Closes gh-5531
2024-08-24 10:05:01 -04:00