fastify-static icon indicating copy to clipboard operation
fastify-static copied to clipboard

fix: disable root path check when serve is false

Open nimesh0505 opened this issue 1 year ago • 0 comments

Summary

This MR addresses the issue #460 where the checkRootPathForErrors function still requires a valid path to root even when serve: false is set.

Changes

  • Disabled checkRootPathForErrors when serve: false.
  • Added a unit test to confirm that the root path check is bypassed when serve: false.

Tests

  • Added a test in test/static.js to verify that checkRootPathForErrors is not called when serve: false.

This fix allows users to use the sendFile decorator without needing to serve static files, as requested.

Checklist

nimesh0505 avatar Aug 30 '24 14:08 nimesh0505