[ML] Disabling secondary auth headers when security is disabled (#72371)

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
This commit is contained in:
James Gowdy 2020-07-20 09:30:06 +01:00 committed by GitHub
parent 7cee2a6b15
commit b39c46eeac
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -7,7 +7,9 @@
import { KibanaRequest } from 'kibana/server';
export function getAuthorizationHeader(request: KibanaRequest) {
return {
headers: { 'es-secondary-authorization': request.headers.authorization },
};
return request.headers.authorization === undefined
? {}
: {
headers: { 'es-secondary-authorization': request.headers.authorization },
};
}