Skip to content

Commit e795ae9

Browse files
committed
fix: force default region when using the legacy api
1 parent b99246c commit e795ae9

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

packages/build/src/plugins_core/blobs_upload/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ const coreStep: CoreStepFunction = async function ({
5050
// If using the deploy config API or the Frameworks API, configure the store
5151
// to use the region that was configured for the deploy. We don't do it for
5252
// the legacy file-based upload API since that would be a breaking change.
53-
if (blobs.apiVersion > 1) {
53+
if (blobs.apiVersion === 1) {
5454
storeOpts.region = 'us-east-2'
5555
}
5656

packages/build/src/plugins_core/dev_blobs_upload/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ const coreStep: CoreStepFunction = async function ({
5151
// If using the deploy config API or the Frameworks API, configure the store
5252
// to use the region that was configured for the deploy. We don't do it for
5353
// the legacy file-based upload API since that would be a breaking change.
54-
if (blobs.apiVersion > 1) {
54+
if (blobs.apiVersion === 1) {
5555
storeOpts.region = 'us-east-2'
5656
}
5757

packages/build/tests/blobs_upload/tests.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,13 @@ test.serial('Blobs upload step uploads files to deploy store (legacy API)', asyn
8787
t.true(success)
8888
t.is(t.context.blobRequests.set.length, 6)
8989

90-
const regionRequests = t.context.blobRequests.set.filter((urlPath) => {
90+
const defaultRegionRequests = t.context.blobRequests.set.filter((urlPath) => {
9191
const url = new URL(urlPath, 'http://localhost')
9292

93-
return url.searchParams.has('region')
93+
return url.searchParams.get('region') === 'us-east-2'
9494
})
9595

96-
t.is(regionRequests.length, 3)
96+
t.is(defaultRegionRequests.length, 3)
9797

9898
const storeOpts = { deployID: 'abc123', siteID: 'test', token: TOKEN }
9999
if (semver.lt(nodeVersion, '18.0.0')) {
@@ -172,7 +172,7 @@ test.serial('Blobs upload step uploads files to deploy store', async (t) => {
172172
return url.searchParams.get('region') === 'auto'
173173
})
174174

175-
t.is(regionAutoRequests.length, 0)
175+
t.is(regionAutoRequests.length, 3)
176176

177177
const storeOpts = { deployID: 'abc123', siteID: 'test', token: TOKEN }
178178
if (semver.lt(nodeVersion, '18.0.0')) {

0 commit comments

Comments
 (0)