From 158c7b80cd25f0750f3d392cf8d03039c08589c5 Mon Sep 17 00:00:00 2001 From: Weidi Deng Date: Sat, 12 Dec 2020 15:08:07 +0800 Subject: [PATCH] fix ci --- http/public.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/http/public.go b/http/public.go index 15c30735..62e7ac61 100644 --- a/http/public.go +++ b/http/public.go @@ -40,7 +40,7 @@ var withHashFile = func(fn handleFunc) handleFunc { // ref to https://github.com/filebrowser/filebrowser/pull/727 // `/api/public/dl/MEEuZK-v/file-name.txt` for old browsers to save file with correct name -func ifPathWithName(r *http.Request) (string, string) { +func ifPathWithName(r *http.Request) (id string, path string) { pathElements := strings.Split(r.URL.Path, "/") // prevent maliciously constructed parameters like `/api/public/dl/XZzCDnK2_not_exists_hash_name` // len(pathElements) will be 1, and golang will panic `runtime error: index out of range`