File tree Expand file tree Collapse file tree
src/legacy/core_plugins/console Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ import { first } from 'rxjs/operators';
2222import { resolve , join , sep } from 'path' ;
2323import url from 'url' ;
2424import { has , isEmpty , head , pick } from 'lodash' ;
25+ import { LiveHostsManager } from './server/live_hosts_manager' ;
2526
2627// @ts -ignore
2728import { addProcessorDefinition } from './server/api_server/es_6_0/ingest' ;
@@ -142,7 +143,8 @@ export default function(kibana: any) {
142143
143144 server . route (
144145 createProxyRoute ( {
145- baseUrl : head ( legacyEsConfig . hosts ) ,
146+ // baseUrl: head(legacyEsConfig.hosts),
147+ liveHostsManager : new LiveHostsManager ( legacyEsConfig . hosts ) ,
146148 pathFilters : proxyPathFilters ,
147149 getConfigForReq ( req : any , uri : any ) {
148150 const filteredHeaders = filterHeaders (
Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ function getProxyHeaders(req) {
5858}
5959
6060export const createProxyRoute = ( {
61- baseUrl = '/' ,
61+ liveHostsManager ,
6262 pathFilters = [ / .* / ] ,
6363 getConfigForReq = ( ) => ( { } ) ,
6464} ) => ( {
@@ -100,6 +100,7 @@ export const createProxyRoute = ({
100100 handler : async ( req , h ) => {
101101 const { payload, query } = req ;
102102 const { path, method } = query ;
103+ const baseUrl = await liveHostsManager . getLiveHost ( ) ;
103104 const uri = toURL ( baseUrl , path ) ;
104105
105106 // Because this can technically be provided by a settings-defined proxy config, we need to
You can’t perform that action at this time.
0 commit comments