Skip to content

Commit

Permalink
[ML] Disabling secondary auth headers when security is disabled (#72371)
Browse files Browse the repository at this point in the history
Co-authored-by: Elastic Machine <[email protected]>
  • Loading branch information
jgowdyelastic and elasticmachine authored Jul 20, 2020
1 parent 7cee2a6 commit b39c46e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions x-pack/plugins/ml/server/lib/request_authorization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
};
}

0 comments on commit b39c46e

Please sign in to comment.