Skip to content

Commit

Permalink
fix: return 404 for /favicon.ico in webpack dev server (Hapi) (#1580)
Browse files Browse the repository at this point in the history
  • Loading branch information
jchip authored Apr 2, 2020
1 parent 0c00a46 commit eae84f2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/xarc-app-dev/lib/dev-admin/dev-hapi.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ function register(server, options, next) {
server.ext({
type: "onRequest",
method: (request, reply) => {
if (request.path === "/favicon.ico") {
return reply("").code(404);
}
const { req } = request.raw;

// simulate a res to capture what the devMiddleware might send back
Expand Down
3 changes: 3 additions & 0 deletions packages/xarc-app-dev/lib/dev-admin/dev-hapi17.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ function register(server) {
server.ext({
type: "onRequest",
method: (request, h) => {
if (request.path === "/favicon.ico") {
return h.response("").code(404).takeover();
}
const { req } = request.raw;

// simulate a res to capture what the devMiddleware might send back
Expand Down

0 comments on commit eae84f2

Please sign in to comment.