diff --git a/frontend/server/app.test.ts b/frontend/server/app.test.ts index 7469267ba4d..3f051ab3c55 100644 --- a/frontend/server/app.test.ts +++ b/frontend/server/app.test.ts @@ -171,7 +171,7 @@ describe('UIServer apis', () => { const request = requests(app.start()); request - .get('/artifacts/get?source=minio&bucket=ml-pipeline&encodedKey=hello%2Fworld.txt') + .get('/artifacts/get?source=minio&bucket=ml-pipeline&key=hello%2Fworld.txt') .expect(200, artifactContent, err => { expect(mockedMinioClient).toBeCalledWith({ accessKey: 'minio', @@ -205,7 +205,7 @@ describe('UIServer apis', () => { const request = requests(app.start()); request - .get('/artifacts/get?source=s3&bucket=ml-pipeline&encodedKey=hello%2Fworld.txt') + .get('/artifacts/get?source=s3&bucket=ml-pipeline&key=hello%2Fworld.txt') .expect(200, artifactContent, err => { expect(mockedMinioClient).toBeCalledWith({ accessKey: 'aws123', @@ -237,7 +237,7 @@ describe('UIServer apis', () => { const request = requests(app.start()); request - .get('/artifacts/get?source=s3&bucket=ml-pipeline&encodedKey=hello%2Fworld.txt') + .get('/artifacts/get?source=s3&bucket=ml-pipeline&key=hello%2Fworld.txt') .expect(200, artifactContent, err => { expect(mockedMinioClient).toBeCalledWith({ accessKey: 'aws123', @@ -263,7 +263,7 @@ describe('UIServer apis', () => { const request = requests(app.start()); request - .get('/artifacts/get?source=http&bucket=ml-pipeline&encodedKey=hello%2Fworld.txt') + .get('/artifacts/get?source=http&bucket=ml-pipeline&key=hello%2Fworld.txt') .expect(200, artifactContent, err => { expect(mockedFetch).toBeCalledWith('http://foo.bar/ml-pipeline/hello/world.txt', { headers: {}, @@ -290,7 +290,7 @@ describe('UIServer apis', () => { const request = requests(app.start()); request - .get('/artifacts/get?source=https&bucket=ml-pipeline&encodedKey=hello%2Fworld.txt') + .get('/artifacts/get?source=https&bucket=ml-pipeline&key=hello%2Fworld.txt') .expect(200, artifactContent, err => { expect(mockedFetch).toBeCalledWith('https://foo.bar/ml-pipeline/hello/world.txt', { headers: { @@ -317,7 +317,7 @@ describe('UIServer apis', () => { const request = requests(app.start()); request - .get('/artifacts/get?source=https&bucket=ml-pipeline&encodedKey=hello%2Fworld.txt') + .get('/artifacts/get?source=https&bucket=ml-pipeline&key=hello%2Fworld.txt') .set('Authorization', 'inheritedToken') .expect(200, artifactContent, err => { expect(mockedFetch).toBeCalledWith('https://foo.bar/ml-pipeline/hello/world.txt', { @@ -346,7 +346,7 @@ describe('UIServer apis', () => { const request = requests(app.start()); request - .get('/artifacts/get?source=gcs&bucket=ml-pipeline&encodedKey=hello%2Fworld.txt') + .get('/artifacts/get?source=gcs&bucket=ml-pipeline&key=hello%2Fworld.txt') .expect(200, artifactContent + '\n', done); }); }); diff --git a/frontend/server/handlers/artifacts.ts b/frontend/server/handlers/artifacts.ts index 0db2c67225d..88ca54e51ce 100644 --- a/frontend/server/handlers/artifacts.ts +++ b/frontend/server/handlers/artifacts.ts @@ -29,7 +29,7 @@ interface ArtifactsQueryStrings { /** bucket name. */ bucket: string; /** artifact key/path that is uri encoded. */ - encodedKey: string; + key: string; } /** @@ -44,7 +44,7 @@ export function getArtifactsHandler(artifactsConfigs: { }): Handler { const { aws, http, minio } = artifactsConfigs; return async (req, res) => { - const { source, bucket, encodedKey } = req.query as Partial; + const { source, bucket, key: encodedKey } = req.query as Partial; if (!source) { res.status(500).send('Storage source is missing from artifact request'); return;