Skip to content

Commit 881e66f

Browse files
authored
Merge pull request #329 from happo/finalize-url
Use correct URL for finalizing signed URL uploads
2 parents 0f7ee39 + e5f6c9b commit 881e66f

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/uploadAssets.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ async function uploadAssetsWithSignedUrl(
122122
// Finally, we need to tell Happo that we've uploaded the assets.
123123
const finalizeRes = await makeRequest(
124124
{
125-
url: `${endpoint}/api/snap-requests/assets/${hash}/finalize`,
125+
url: `${endpoint}/api/snap-requests/assets/${hash}/signed-url/finalize`,
126126
method: 'POST',
127127
json: true,
128128
},

test/integrations/react-test.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,9 @@ beforeEach(() => {
8181
},
8282
},
8383

84-
'POST /assets/:hash/finalize': {
84+
'POST /assets/:hash/signed-url/finalize': {
8585
method: 'POST',
86-
url: /\/assets\/[a-f0-9]+\/finalize$/,
86+
url: /\/assets\/[a-f0-9]+\/signed-url\/finalize$/,
8787
handler: (req, res) => {
8888
const parts = req.url.split('/');
8989
const hash = parts[parts.length - 2];
@@ -462,7 +462,9 @@ describe('when HAPPO_SIGNED_URL is set', () => {
462462
expect(receivedRequests[1].url).toMatch(/\/a-signed-url$/);
463463

464464
expect(receivedRequests[2].method).toBe('POST');
465-
expect(receivedRequests[2].url).toMatch(/\/assets\/[a-f0-9]+\/finalize$/);
465+
expect(receivedRequests[2].url).toMatch(
466+
/\/assets\/[a-f0-9]+\/signed-url\/finalize$/,
467+
);
466468

467469
// The request after the asset has been finalized is posting the report
468470
expect(receivedRequests[3].method).toBe('POST');

0 commit comments

Comments
 (0)