Skip to content

Commit

Permalink
Removed mandatory apiKey
Browse files Browse the repository at this point in the history
  • Loading branch information
binarymist committed Oct 30, 2018
1 parent eab18b7 commit c398214
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,14 @@ function ClientApi(options) {
_.defaults(options, {
proxy: 'http://127.0.0.1:8080'
});

if (!options.apiKey) throw new Error('An apiKey must be provided for the Zap API.');

const requestOptions = {
method: 'GET',
json: true,
apiKey: options.apiKey,
proxy: options.proxy
};

if (options.apiKey) requestOptions.headers = { 'X-ZAP-API-Key': options.apiKey };

this.req = request.defaults(requestOptions);
this.reqPromise = requestPromise.defaults(requestOptions);
Expand Down

0 comments on commit c398214

Please sign in to comment.