~rjarry/dlrepo

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
2 2

[PATCH dlrepo] views: catch exception on invalid fmt name

Details
Message ID
<20250310090643.4129549-1-julien.floret@6wind.com>
Sender timestamp
1741601203
DKIM signature
pass
Download raw message
Patch: +1 -1
Attempting to upload to a invalid format name (name starting with a
"." or containing a "/") resulted in error "500 Internal Server
Error". Let's catch the exception to get error "404: Not Found"
instead.

Signed-off-by: Julien Floret <julien.floret@6wind.com>
Acked-by: Thomas Faivre <thomas.faivre@6wind.com>
---
 dlrepo/views/artifact.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dlrepo/views/artifact.py b/dlrepo/views/artifact.py
index dcd40ca992d2..e7dc1bcef067 100644
--- a/dlrepo/views/artifact.py
+++ b/dlrepo/views/artifact.py
@@ -50,9 +50,9 @@ class ArtifactView(BaseView):
                    .get_tag(match["tag"], access_cb)
                    .get_job(match["job"])
                )
                fmt = job.get_format(match["format"])
            except FileNotFoundError as e:
                raise web.HTTPNotFound() from e
            fmt = job.get_format(match["format"])
            if create:
                if match["format"] == "container":
                    agent = self.request.headers.get("User-Agent", "")
-- 
2.39.2

[dlrepo/patches/.build.yml] build success

builds.sr.ht <builds@sr.ht>
Details
Message ID
<D8CGUNFTPOBP.2LVRA1XCKQU3R@fra02>
In-Reply-To
<20250310090643.4129549-1-julien.floret@6wind.com> (view parent)
Sender timestamp
1741597677
DKIM signature
missing
Download raw message
dlrepo/patches/.build.yml: SUCCESS in 56s

[views: catch exception on invalid fmt name][0] from [~jfloret][1]

[0]: https://lists.sr.ht/~rjarry/dlrepo/patches/57990
[1]: julien.floret@6wind.com

✓ #1446339 SUCCESS dlrepo/patches/.build.yml https://builds.sr.ht/~rjarry/job/1446339

Applied: [PATCH dlrepo] views: catch exception on invalid fmt name

Details
Message ID
<174248085893.274829.7729294097931437346@ringo>
In-Reply-To
<20250310090643.4129549-1-julien.floret@6wind.com> (view parent)
Sender timestamp
1742484458
DKIM signature
pass
Download raw message
Julien Floret <julien.floret@6wind.com> wrote:
> Attempting to upload to a invalid format name (name starting with a
> "." or containing a "/") resulted in error "500 Internal Server
> Error". Let's catch the exception to get error "404: Not Found"
> instead.
>
> Signed-off-by: Julien Floret <julien.floret@6wind.com>
> Acked-by: Thomas Faivre <thomas.faivre@6wind.com>
> ---

Acked-by: Robin Jarry <robin@jarry.cc>

Applied, thanks.

To git@git.sr.ht:~rjarry/dlrepo
   a1b083dddcf5..01ffaabe716d  main -> main
Reply to thread Export thread (mbox)