Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for setRequestOptions #685

Merged
merged 1 commit into from
Apr 12, 2018

Conversation

krishnasrinivas
Copy link
Contributor

@krishnasrinivas krishnasrinivas commented Apr 11, 2018

Support for setting http request options (things like http agent, TLS related configs)

if (!isObject(options)) {
throw new TypeError('request options should be of type "object"')
}
this.reqOptions = _.pick(options, ['agent', 'ca', 'cert', 'ciphers', 'clientCertEngine', 'crl', 'dhparam', 'ecdhCurve', 'honorCipherOrder', 'key', 'passphrase', 'pfx', 'rejectUnauthorized', 'secureOptions', 'secureProtocol', 'servername', 'sessionIdContext'])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure why this is needed, in addition this list needs to be updated when nodejs tls API gets updated.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is needed for developers to pass custom agent or TLS related configs (custom certs) Have a look at the discussion on #677

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is needed for developers to pass custom agent or TLS related configs (custom certs) Have a look at the discussion on #677

I mean why this is not only this.reqOptions = options, why are we picking specific fields ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because we dont want to let the user provide option.host option.headers etc even by mistake which cause minio-js calls to fail

@vadmeste
Copy link
Member

@krishnasrinivas, it looks like this PR conflicts with this #686, can you take a look ?

@krishnasrinivas
Copy link
Contributor Author

@krishnasrinivas, it looks like this PR conflicts with this #686, can you take a look ?

once this PR is merged the other PR will not show the conflict @vadmeste

Copy link
Contributor

@kannappanr kannappanr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@vadmeste vadmeste left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM & tested

@kannappanr kannappanr merged commit 758cd89 into minio:master Apr 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants