Skip to content
Open
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
8 changes: 8 additions & 0 deletions dist/aws4fetch.cjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,14 @@ function guessServiceRegion(url, headers) {
const match = hostname.match(/^(?:[^.]{1,63}\.)?s3\.([^.]{1,63})\.backblazeb2\.com$/);
return match != null ? ['s3', match[1] || ''] : ['', '']
}
if (hostname.endsWith('.linodeobjects.com')) {
const match = hostname.match(/^(?:[^.]{1,63}\.)?([^.]{1,63})\.linodeobjects\.com$/);
return match != null ? ['s3', match[1] || ''] : ['', '']
}
if (hostname.endsWith('.digitaloceanspaces.com')) {
const match = hostname.match(/^(?:[^.]{1,63}\.)?([^.]{1,63})\.digitaloceanspaces\.com$/);
return match != null ? ['s3', match[1] || ''] : ['', '']
}
const match = hostname.replace('dualstack.', '').match(/([^.]{1,63})\.(?:([^.]{0,63})\.)?amazonaws\.com(?:\.cn)?$/);
let service = (match && match[1]) || '';
let region = match && match[2];
Expand Down
8 changes: 8 additions & 0 deletions dist/aws4fetch.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,14 @@ function guessServiceRegion(url, headers) {
const match = hostname.match(/^(?:[^.]{1,63}\.)?s3\.([^.]{1,63})\.backblazeb2\.com$/);
return match != null ? ['s3', match[1] || ''] : ['', '']
}
if (hostname.endsWith('.linodeobjects.com')) {
const match = hostname.match(/^(?:[^.]{1,63}\.)?([^.]{1,63})\.linodeobjects\.com$/);
return match != null ? ['s3', match[1] || ''] : ['', '']
}
if (hostname.endsWith('.digitaloceanspaces.com')) {
const match = hostname.match(/^(?:[^.]{1,63}\.)?([^.]{1,63})\.digitaloceanspaces\.com$/);
return match != null ? ['s3', match[1] || ''] : ['', '']
}
const match = hostname.replace('dualstack.', '').match(/([^.]{1,63})\.(?:([^.]{0,63})\.)?amazonaws\.com(?:\.cn)?$/);
let service = (match && match[1]) || '';
let region = match && match[2];
Expand Down
8 changes: 8 additions & 0 deletions dist/aws4fetch.esm.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,14 @@ function guessServiceRegion(url, headers) {
const match = hostname.match(/^(?:[^.]{1,63}\.)?s3\.([^.]{1,63})\.backblazeb2\.com$/);
return match != null ? ['s3', match[1] || ''] : ['', '']
}
if (hostname.endsWith('.linodeobjects.com')) {
const match = hostname.match(/^(?:[^.]{1,63}\.)?([^.]{1,63})\.linodeobjects\.com$/);
return match != null ? ['s3', match[1] || ''] : ['', '']
}
if (hostname.endsWith('.digitaloceanspaces.com')) {
const match = hostname.match(/^(?:[^.]{1,63}\.)?([^.]{1,63})\.digitaloceanspaces\.com$/);
return match != null ? ['s3', match[1] || ''] : ['', '']
}
const match = hostname.replace('dualstack.', '').match(/([^.]{1,63})\.(?:([^.]{0,63})\.)?amazonaws\.com(?:\.cn)?$/);
let service = (match && match[1]) || '';
let region = match && match[2];
Expand Down
8 changes: 8 additions & 0 deletions dist/aws4fetch.umd.js
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,14 @@
const match = hostname.match(/^(?:[^.]{1,63}\.)?s3\.([^.]{1,63})\.backblazeb2\.com$/);
return match != null ? ['s3', match[1] || ''] : ['', '']
}
if (hostname.endsWith('.linodeobjects.com')) {
const match = hostname.match(/^(?:[^.]{1,63}\.)?([^.]{1,63})\.linodeobjects\.com$/);
return match != null ? ['s3', match[1] || ''] : ['', '']
}
if (hostname.endsWith('.digitaloceanspaces.com')) {
const match = hostname.match(/^(?:[^.]{1,63}\.)?([^.]{1,63})\.digitaloceanspaces\.com$/);
return match != null ? ['s3', match[1] || ''] : ['', '']
}
const match = hostname.replace('dualstack.', '').match(/([^.]{1,63})\.(?:([^.]{0,63})\.)?amazonaws\.com(?:\.cn)?$/);
let service = (match && match[1]) || '';
let region = match && match[2];
Expand Down
8 changes: 8 additions & 0 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,14 @@ function guessServiceRegion(url, headers) {
const match = hostname.match(/^(?:[^.]{1,63}\.)?s3\.([^.]{1,63})\.backblazeb2\.com$/)
return match != null ? ['s3', match[1] || ''] : ['', '']
}
if (hostname.endsWith('.linodeobjects.com')) {
const match = hostname.match(/^(?:[^.]{1,63}\.)?([^.]{1,63})\.linodeobjects\.com$/)
return match != null ? ['s3', match[1] || ''] : ['', '']
}
if (hostname.endsWith('.digitaloceanspaces.com')) {
const match = hostname.match(/^(?:[^.]{1,63}\.)?([^.]{1,63})\.digitaloceanspaces\.com$/)
return match != null ? ['s3', match[1] || ''] : ['', '']
}
const match = hostname.replace('dualstack.', '').match(/([^.]{1,63})\.(?:([^.]{0,63})\.)?amazonaws\.com(?:\.cn)?$/)
let service = (match && match[1]) || ''
let region = match && match[2]
Expand Down
4 changes: 4 additions & 0 deletions test/serviceTests.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ aa-custom-bucket.s3.us-west-001.backblazeb2.com,s3,us-west-001
s3.us-west-001.backblazeb2.com,s3,us-west-001
12345678.r2.cloudflarestorage.com,s3,auto
aa-custom-bucket.12345678.r2.cloudflarestorage.com,s3,auto
my-repo.us-sea-1.linodeobjects.com,s3,us-sea-1
us-sea-1.linodeobjects.com,s3,us-sea-1
my-space.nyc3.digitaloceanspaces.com,s3,nyc3
nyc3.digitaloceanspaces.com,s3,nyc3
ibvt72cx3dkyksnw7jktvkwhme0legmv.lambda-url.us-east-1.on.aws,lambda,us-east-1
`
return csv.trim().split('\n').map(line => {
Expand Down