Skip to content

Commit

Permalink
Add support to pass basic-auth in endpoint url (opendistro-for-elasti…
Browse files Browse the repository at this point in the history
…csearch#34)

Fixes issue (opendistro-for-elasticsearch#34)  where user can pass basic auth credentials in the
endpoint

example :
```
perf-top --endpoint https://username:password@cluster_endpoint --dashboard ClusterOverview

```
  • Loading branch information
keety committed Jan 21, 2020
1 parent 641602d commit 01fc202
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/perf-top/util/generate-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ function getURLOptions (endpoint, path) {
return {
protocol: parsedURL.protocol,
host: parsedURL.hostname,
port: (parsedURL.port === null) ? 80 : parsedURL.port,
auth: parsedURL.auth,
port: (parsedURL.port === null) ? (parsedURL.protocol === 'https:' ? 443 : 80 ): parsedURL.port,
path: parsedURL.path
};
}
Expand Down

0 comments on commit 01fc202

Please sign in to comment.