Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: disable root path check when serve is false #466

Closed

Conversation

nimesh0505
Copy link

@nimesh0505 nimesh0505 commented Aug 30, 2024

Summary

This MR addresses the issue 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

@Uzlopak
Copy link
Contributor

Uzlopak commented Aug 30, 2024

Imho this PR does not take in account, that if no general root path is defined, that rootPath parameter of sendFile becomes mandatory.

root || sendOptions.root,

@nimesh0505 nimesh0505 closed this Aug 30, 2024
@nimesh0505 nimesh0505 deleted the fix-disable-rootpath-check branch August 30, 2024 14:50
@Uzlopak
Copy link
Contributor

Uzlopak commented Aug 30, 2024

why closing so fast? You can do it! :)

@nimesh0505
Copy link
Author

@Uzlopak Here is the PR 😅

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