Skip to content

Commit

Permalink
Send CORS headers when a file does not exist (#2669)
Browse files Browse the repository at this point in the history
  • Loading branch information
Taym95 authored and devongovett committed Feb 25, 2019
1 parent a69de78 commit 0b98eed
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/core/parcel-bundler/src/Server.js
Expand Up @@ -79,6 +79,7 @@ function middleware(bundler) {
}

function send500(error) {
setHeaders(res);
res.setHeader('Content-Type', 'text/html; charset=utf-8');
res.writeHead(500);
let errorMesssge = '<h1>🚨 Build Error</h1>';
Expand Down Expand Up @@ -106,7 +107,7 @@ function middleware(bundler) {
if (next) {
return next();
}

setHeaders(res);
res.writeHead(404);
res.end();
}
Expand Down

0 comments on commit 0b98eed

Please sign in to comment.