Skip to content

Commit

Permalink
Fixing issues with the url.search being null in Node 10 (#26992) (#27007
Browse files Browse the repository at this point in the history
)

Node 10 uses `null` to denote the non-existence of a querystring
parameter when `url.parse(urlString, true)` is used, the following
changes fix our usages within the security plugin.
  • Loading branch information
kobelb authored Dec 12, 2018
1 parent 98b075d commit 86c9a69
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export class BasicAuthenticationProvider {
// Query string may contain the path where logout has been called or
// logout reason that login page may need to know.
return DeauthenticationResult.redirectTo(
`${this._options.basePath}/login${request.url.search}`
`${this._options.basePath}/login${request.url.search || ''}`
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ export class SAMLAuthenticationProvider {
logoutArgs = [
'shield.samlInvalidate',
// Elasticsearch expects `queryString` without leading `?`, so we should strip it with `slice`.
{ body: { queryString: request.url.search.slice(1), acs: this._getACS() } }
{ body: { queryString: request.url.search ? request.url.search.slice(1) : '', acs: this._getACS() } }
];
} else {
this._options.log(['debug', 'security', 'saml'], 'Logout has been initiated by the user.');
Expand Down

0 comments on commit 86c9a69

Please sign in to comment.