Skip to content

Commit ad7990d

Browse files
committed
Fix region value case insensitive
1 parent 4050b7c commit ad7990d

4 files changed

Lines changed: 7 additions & 4 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
### v3.0.1
2+
- Fixed SWIFT authentication: the `region` value is case insensitive, it can be `GRA` or `gra`.
3+
14
### v3.0.0
25
- New major version to make S3 and Swift methods identical (function arguments and callback functions)
36
- SWIFT Breaking changes:

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "tiny-storage-client",
3-
"version": "3.0.0",
3+
"version": "3.0.1",
44
"description": "Tiny node client to request distributed AWS S3 or the OpenStack Swift Object Storage.",
55
"main": "index.js",
66
"scripts": {

swift.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ module.exports = (config) => {
9898
}
9999

100100
_config.endpoints = _serviceCatalog.endpoints.find((element) => {
101-
return element.region === _storage.region;
101+
return element.region?.toLowerCase() === _storage.region?.toLowerCase();
102102
});
103103

104104
if (!_config.endpoints) {

tests/swift.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,12 +136,12 @@ describe('Ovh Object Storage Swift', function () {
136136

137137
describe('Connection', function () {
138138

139-
it('should connect to object storage swift (without tenantName)', function(done) {
139+
it('should connect to object storage swift (without tenantName and the region as lowercase)', function(done) {
140140
let storageTest = storageSDK([{
141141
username : 'storage-X-user',
142142
password : 'storage-X-password',
143143
authUrl : authURL,
144-
region : 'GRA'
144+
region : 'gra'
145145
}]);
146146

147147
const firstNock = nock(authURL)

0 commit comments

Comments
 (0)