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

fix error not thrown when secure param is passed #715

Merged
merged 1 commit into from
Sep 4, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/main/minio.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ var Package = require('../../package.json')

export class Client {
constructor(params) {
if (params.secure) throw new Error('"secure" option deprecated, "useSSL" should be used instead')
if (typeof params.secure !== 'undefined') throw new Error('"secure" option deprecated, "useSSL" should be used instead')
// Default values if not specified.
if (typeof params.useSSL === 'undefined') params.useSSL = true
if (!params.port) params.port = 0
Expand Down
26 changes: 26 additions & 0 deletions src/test/unit/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,32 @@ describe('Client', function() {
done()
}
})
it('should fail when secure param is passed', (done) => {
try {
new Minio.Client({
endPoint: 'localhost',
secure: false,
port: 9000,
accessKey: 'accesskey',
secretKey: 'secretkey'
})
} catch (e) {
done()
}
})
it('should fail when secure param is passed', (done) => {
try {
new Minio.Client({
endPoint: 'localhost',
secure: true,
port: 9000,
accessKey: 'accesskey',
secretKey: 'secretkey'
})
} catch (e) {
done()
}
})
})
describe('Presigned URL', () => {
describe('presigned-get', () => {
Expand Down