Skip to content

Commit 625ecea

Browse files
committed
Prevented error in chrome when dev-tools open
Not sure why this didn't error before, but with dev-tools open chrome requests well-known/appspecific/com.chrome.devtools.json - so returned 404 like with favicon
1 parent c6716cf commit 625ecea

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

NavigationReact/sample/rsc-parcel/src/server.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const app = express();
1313
app.use(express.static('dist'));
1414
app.use(express.json());
1515

16-
app.get('/favicon.ico', function (req, res) {
16+
app.get(['/favicon.ico', '/.well-known/*.json'], function (req, res) {
1717
res.statusCode = 404;
1818
res.end();
1919
});

NavigationReact/sample/rsc-webpack/server/global.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ const {PassThrough} = require('stream');
4242
const app = express();
4343

4444
app.use(compress());
45-
app.get('/favicon.ico', function (req, res) {
45+
app.get(['/favicon.ico', '/.well-known/*.json'], function (req, res) {
4646
res.statusCode = 404;
4747
res.end();
4848
});
@@ -97,8 +97,9 @@ async function renderApp(req, res, next) {
9797
'X-Forwarded-For': req.ips,
9898
'X-Forwarded-Port': 3000,
9999
'X-Forwarded-Proto': req.protocol,
100-
'Accept': req.get('Accept'),
101100
};
101+
if (req.get('Accept'))
102+
proxiedHeaders['Accept'] = req.get('Accept');
102103
if (req.get('Content-type'))
103104
proxiedHeaders['Content-type'] = req.get('Content-type');
104105

NavigationReactMobile/sample/rsc/src/server.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const app = express();
1313
app.use(express.static('dist'));
1414
app.use(express.json());
1515

16-
app.get('/favicon.ico', function (req, res) {
16+
app.get(['/favicon.ico', '/.well-known/*.json'], function (req, res) {
1717
res.statusCode = 404;
1818
res.end();
1919
});

0 commit comments

Comments
 (0)