We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4fe2d11 commit 8fd7409Copy full SHA for 8fd7409
.changeset/dry-tips-do.md
@@ -0,0 +1,5 @@
1
+---
2
+"react-email": patch
3
4
+
5
+Fix static files regression
packages/react-email/src/cli/utils/preview/serve-static-file.ts
@@ -14,13 +14,7 @@ export const serveStaticFile = async (
14
const pathname = parsedUrl.pathname!;
15
const ext = path.parse(pathname).ext;
16
17
- const fileAbsolutePath = path.resolve(staticBaseDir, pathname);
18
-
19
- if (!fileAbsolutePath.startsWith(staticBaseDir)) {
20
- res.statusCode = 403;
21
- res.end();
22
- return;
23
- }
+ const fileAbsolutePath = path.join(staticBaseDir, pathname);
24
25
try {
26
const fileHandle = await fs.open(fileAbsolutePath, 'r');
0 commit comments