From 793a4ea6ca45e0b9fd44d0cbcddd563d83749d8f Mon Sep 17 00:00:00 2001 From: tukipona <161995125+tukipona@users.noreply.github.com> Date: Fri, 12 Apr 2024 21:45:16 +0800 Subject: [PATCH] fix(cloudreve): add domain to the download url if not exists (#6339 close #6265) * fix: correct the download url got by Cloudreve driver * fix: add an condition to the correction --- drivers/cloudreve/driver.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/cloudreve/driver.go b/drivers/cloudreve/driver.go index 49c2d5f00f2..dc6d1b13213 100644 --- a/drivers/cloudreve/driver.go +++ b/drivers/cloudreve/driver.go @@ -71,6 +71,9 @@ func (d *Cloudreve) Link(ctx context.Context, file model.Obj, args model.LinkArg if err != nil { return nil, err } + if strings.HasPrefix(dUrl, "/api") { + dUrl = d.Address + dUrl + } return &model.Link{ URL: dUrl, }, nil