webpack-hot-middleware
Advanced tools
Comparing version 2.22.2 to 2.22.3
@@ -60,12 +60,20 @@ module.exports = webpackHotMiddleware; | ||
handler: function(req, res) { | ||
req.socket.setKeepAlive(true); | ||
res.writeHead(200, { | ||
var headers = { | ||
'Access-Control-Allow-Origin': '*', | ||
'Content-Type': 'text/event-stream;charset=utf-8', | ||
'Cache-Control': 'no-cache, no-transform', | ||
'Connection': 'keep-alive', | ||
// While behind nginx, event stream should not be buffered: | ||
// http://nginx.org/docs/http/ngx_http_proxy_module.html#proxy_buffering | ||
'X-Accel-Buffering': 'no' | ||
}); | ||
}; | ||
var isHttp1 = !(parseInt(req.httpVersion) >= 2); | ||
if (isHttp1) { | ||
req.socket.setKeepAlive(true); | ||
Object.assign(headers, { | ||
'Connection': 'keep-alive', | ||
}); | ||
} | ||
res.writeHead(200, headers); | ||
res.write('\n'); | ||
@@ -72,0 +80,0 @@ var id = clientId++; |
{ | ||
"name": "webpack-hot-middleware", | ||
"version": "2.22.2", | ||
"version": "2.22.3", | ||
"description": "Webpack hot reloading you can attach to your own server", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
29980
606