From 2f461f13e3efe603bdd8fb4057f3e8242a59956f Mon Sep 17 00:00:00 2001 From: Lesmiscore Date: Fri, 22 Jul 2022 12:52:48 +0900 Subject: [PATCH] internetarchive: handle hash symbol in the middle of filename --- backend/internetarchive/internetarchive.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/internetarchive/internetarchive.go b/backend/internetarchive/internetarchive.go index b7a0676b5..db553eda1 100644 --- a/backend/internetarchive/internetarchive.go +++ b/backend/internetarchive/internetarchive.go @@ -572,7 +572,7 @@ func (f *Fs) PublicLink(ctx context.Context, remote string, expire fs.Duration, return "", err } bucket, bucketPath := f.split(remote) - return path.Join(f.opt.FrontEndpoint, "/download/", bucket, bucketPath), nil + return path.Join(f.opt.FrontEndpoint, "/download/", bucket, quotePath(bucketPath)), nil } // Copy src to this remote using server-side copy operations. @@ -760,7 +760,7 @@ func (o *Object) Open(ctx context.Context, options ...fs.OpenOption) (in io.Read // make a GET request to (frontend)/download/:item/:path opts := rest.Opts{ Method: "GET", - Path: path.Join("/download/", o.fs.root, o.fs.opt.Enc.FromStandardPath(o.remote)), + Path: path.Join("/download/", o.fs.root, quotePath(o.fs.opt.Enc.FromStandardPath(o.remote))), Options: optionsFixed, } err = o.fs.pacer.Call(func() (bool, error) {