Update browsersync proxy request callback to use dynamic host

This commit is contained in:
Bruno Alla 2019-03-22 10:51:48 +00:00
parent 7e96773d6e
commit b6ad5715ec

View File

@ -134,9 +134,9 @@ function initBrowserSync() {
proxy: {
target: 'django:8000',
proxyReq: [
function(proxyReq) {
// Set to the browsersync host & port to have email links working
proxyReq.setHeader('Host', 'localhost:3000')
function(proxyReq, req) {
// Assign proxy "host" header same as current request at Browsersync server
proxyReq.setHeader('Host', req.headers.host)
}
]
}