diff --git a/backend/src/routes/api/storage/index.ts b/backend/src/routes/api/storage/index.ts index a3a1c09f48..4a71904ecd 100644 --- a/backend/src/routes/api/storage/index.ts +++ b/backend/src/routes/api/storage/index.ts @@ -6,17 +6,17 @@ import { getAccessToken } from '../../../utils/directCallUtils'; import { OauthFastifyRequest } from '../../../types'; export default async (fastify: FastifyInstance): Promise => { - const dashConfig = getDashboardConfig(); - if (dashConfig?.spec.dashboardConfig.disableS3Endpoint === false) { - fastify.get( - '/:namespace/:bucket', - async ( - request: OauthFastifyRequest<{ - Querystring: { key: string; peek?: number }; - Params: { namespace: string; bucket: string }; - }>, - reply: FastifyReply, - ) => { + fastify.get( + '/:namespace/:bucket', + async ( + request: OauthFastifyRequest<{ + Querystring: { key: string; peek?: number }; + Params: { namespace: string; bucket: string }; + }>, + reply: FastifyReply, + ) => { + const dashConfig = getDashboardConfig(); + if (dashConfig?.spec.dashboardConfig.disableS3Endpoint === false) { try { const { namespace, bucket } = request.params; const { key, peek } = request.query; @@ -56,7 +56,10 @@ export default async (fastify: FastifyInstance): Promise => { reply.code(500).send(err.message); return reply; } - }, - ); - } + } else { + reply.code(404).send('Not found'); + return reply; + } + }, + ); }; diff --git a/frontend/src/concepts/pipelines/content/artifacts/ArtifactUriLink.tsx b/frontend/src/concepts/pipelines/content/artifacts/ArtifactUriLink.tsx index 4e6bc219c9..d15ddc2a63 100644 --- a/frontend/src/concepts/pipelines/content/artifacts/ArtifactUriLink.tsx +++ b/frontend/src/concepts/pipelines/content/artifacts/ArtifactUriLink.tsx @@ -1,6 +1,5 @@ import React from 'react'; -import { Link } from 'react-router-dom'; -import { Split, SplitItem } from '@patternfly/react-core'; +import { Button, Split, SplitItem } from '@patternfly/react-core'; import { DownloadIcon } from '@patternfly/react-icons'; import { usePipelinesAPI } from '~/concepts/pipelines/context'; import { useIsAreaAvailable, SupportedArea } from '~/concepts/areas'; @@ -38,9 +37,14 @@ export const ArtifactUriLink: React.FC = ({ {directDownload && ( - - - +