Skip to content

Commit

Permalink
[SPA] Adds Keep-Alive header to avoid console errors on Mac and Linux (
Browse files Browse the repository at this point in the history
…#28)

The HPM proxy sends Connection: close headers and that results in Kestrel closing the connection and the proxy failing.
  • Loading branch information
javiercn authored Nov 12, 2021
1 parent 55da9ce commit 4f69771
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/content/Angular-CSharp/ClientApp/proxy.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ const PROXY_CONFIG = [
//#endif
],
target: target,
secure: false
secure: false,
headers: {
Connection: 'Keep-Alive'
}
}
]

Expand Down
5 changes: 4 additions & 1 deletion src/content/React-CSharp/ClientApp/src/setupProxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ const context = [
module.exports = function(app) {
const appProxy = createProxyMiddleware(context, {
target: target,
secure: false
secure: false,
headers: {
Connection: 'Keep-Alive'
}
});

app.use(appProxy);
Expand Down

0 comments on commit 4f69771

Please sign in to comment.