mirror of
https://github.com/zitadel/zitadel.git
synced 2025-12-02 14:12:27 +00:00
fix(assets-api): Add error handling for missing file paths (#10938)
This commit is contained in:
@@ -213,7 +213,12 @@ func DownloadHandleFunc(s AssetsService, downloader Downloader) func(http.Respon
|
|||||||
resourceOwner := downloader.ResourceOwner(ctx, ownerPath)
|
resourceOwner := downloader.ResourceOwner(ctx, ownerPath)
|
||||||
path := ""
|
path := ""
|
||||||
if ownerPath != "" {
|
if ownerPath != "" {
|
||||||
path = strings.Split(r.RequestURI, ownerPath+"/")[1]
|
splitPath := strings.Split(r.RequestURI, ownerPath+"/")
|
||||||
|
if len(splitPath) < 2 {
|
||||||
|
s.ErrorHandler()(w, r, fmt.Errorf("invalid request URI format: %v", r.RequestURI), http.StatusNotFound)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
path = splitPath[1]
|
||||||
}
|
}
|
||||||
objectName, err := downloader.ObjectName(ctx, path)
|
objectName, err := downloader.ObjectName(ctx, path)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user