1
0
mirror of https://github.com/ansible/awx.git synced 2024-11-02 09:51:09 +03:00

Fix webpack-dev-server proxy to accommodate auth changes

This commit is contained in:
gconsidine 2018-03-12 15:19:01 -04:00 committed by Jake McDermott
parent 81c85913ac
commit e3d42d8e1b

View File

@ -55,26 +55,37 @@ const watch = {
host: '127.0.0.1',
https: true,
port: 3000,
https: true,
clientLogLevel: 'none',
proxy: {
'/': {
target: TARGET,
secure: false,
ws: false,
bypass: req => req.originalUrl.includes('hot-update.json')
},
'/websocket': {
target: TARGET,
secure: false,
ws: true
},
'/network_ui': {
target: TARGET,
secure: false,
ws: true
proxy: [{
context: (pathname, req) => !(pathname === '/api/login/' && req.method === 'POST'),
target: TARGET,
secure: false,
ws: false,
bypass: req => req.originalUrl.includes('hot-update.json')
},
{
context: '/api/login/',
target: TARGET,
secure: false,
ws: false,
headers: {
Host: `localhost:${TARGET_PORT}`,
Origin: TARGET,
Referer: `${TARGET}/`
}
}
},
{
context: '/websocket',
target: TARGET,
secure: false,
ws: true
},
{
context: '/network_ui',
target: TARGET,
secure: false,
ws: true
}]
}
};