From bc985105031b83397054132d115ed5c04da3d6ba Mon Sep 17 00:00:00 2001 From: Sunny Luo Date: Wed, 20 Mar 2019 21:41:16 +0800 Subject: [PATCH] feat: Add hint for browser extensions that may break debug (#253) * Add hint for browser extensions that may break debug * Update getSecurityHeadersMiddleware.js * Fix lint error --- .../server/middleware/getSecurityHeadersMiddleware.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/cli/src/commands/server/middleware/getSecurityHeadersMiddleware.js b/packages/cli/src/commands/server/middleware/getSecurityHeadersMiddleware.js index d5cf6b1452..38de1c2324 100644 --- a/packages/cli/src/commands/server/middleware/getSecurityHeadersMiddleware.js +++ b/packages/cli/src/commands/server/middleware/getSecurityHeadersMiddleware.js @@ -16,7 +16,13 @@ export default function getSecurityHeadersMiddleware(req, res, next) { req.headers.origin && req.headers.origin !== `http://localhost:${address.port}` ) { - next(new Error('Unauthorized')); + next( + new Error( + 'Unauthorized request from ' + + req.headers.origin + + '. This may happen because of a conflicting browser extension. Please try to disable it and try again.', + ), + ); return; }