aboutsummaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorLibravatar Rutger Broekhoff2023-12-29 23:48:03 +0100
committerLibravatar Rutger Broekhoff2023-12-29 23:48:03 +0100
commite81fc818f988f3230d1146f15f5e3ad71449a5da (patch)
treea785d8069f7b88a4ababd84fb5b6ab762f9d0837 /cmd
parent15184289c033f204635b6aa57708cdf6781b98a4 (diff)
downloadgitolfs3-e81fc818f988f3230d1146f15f5e3ad71449a5da.tar.gz
gitolfs3-e81fc818f988f3230d1146f15f5e3ad71449a5da.zip
Swap strings.TrimPrefix args
Diffstat (limited to 'cmd')
-rw-r--r--cmd/git-lfs-server/main.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/cmd/git-lfs-server/main.go b/cmd/git-lfs-server/main.go
index 2b75b3d..50675ae 100644
--- a/cmd/git-lfs-server/main.go
+++ b/cmd/git-lfs-server/main.go
@@ -208,7 +208,7 @@ func (h *handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
208 reqPath = r.URL.Path 208 reqPath = r.URL.Path
209 } 209 }
210 log("reqPath: %s", reqPath) 210 log("reqPath: %s", reqPath)
211 reqPath = strings.TrimPrefix("/", path.Clean(reqPath)) 211 reqPath = strings.TrimPrefix(path.Clean(reqPath), "/")
212 log("Cleaned reqPath: %s", reqPath) 212 log("Cleaned reqPath: %s", reqPath)
213 submatches := re.FindStringSubmatch(reqPath) 213 submatches := re.FindStringSubmatch(reqPath)
214 if len(submatches) != 2 { 214 if len(submatches) != 2 {
@@ -216,7 +216,7 @@ func (h *handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
216 makeRespError(w, "Not found", http.StatusNotFound) 216 makeRespError(w, "Not found", http.StatusNotFound)
217 return 217 return
218 } 218 }
219 repo := strings.TrimPrefix("/", path.Clean(submatches[1])) 219 repo := strings.TrimPrefix(path.Clean(submatches[1]), "/")
220 log("Repository: %s", repo) 220 log("Repository: %s", repo)
221 221
222 if !slices.ContainsFunc(r.Header.Values("Accept"), isLFSMediaType) { 222 if !slices.ContainsFunc(r.Header.Values("Accept"), isLFSMediaType) {