Skip to content

Commit

Permalink
Send CORS headers when a file does not exist (parcel-bundler#2669)
Browse files Browse the repository at this point in the history
  • Loading branch information
Taym95 authored and garthenweb committed Feb 25, 2019
1 parent 644abc7 commit e0011e9
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 e0011e9

Please sign in to comment.