aboutsummaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorLibravatar Rutger Broekhoff2023-12-29 23:25:25 +0100
committerLibravatar Rutger Broekhoff2023-12-29 23:25:25 +0100
commitfe3e8c4d02c3ab9528a10b93c3f401f938895a30 (patch)
treeda12e9c36c0d9be580cfd9cd0ece5c865697df1e /cmd
parent1ba17990d3bf73205f7829493bcf691724092240 (diff)
downloadgitolfs3-fe3e8c4d02c3ab9528a10b93c3f401f938895a30.tar.gz
gitolfs3-fe3e8c4d02c3ab9528a10b93c3f401f938895a30.zip
Prefer PATH_INFO over request URL
Diffstat (limited to 'cmd')
-rw-r--r--cmd/git-lfs-server/main.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/cmd/git-lfs-server/main.go b/cmd/git-lfs-server/main.go
index 6688f68..f59269e 100644
--- a/cmd/git-lfs-server/main.go
+++ b/cmd/git-lfs-server/main.go
@@ -203,7 +203,11 @@ func isLFSMediaType(t string) bool {
203} 203}
204 204
205func (h *handler) ServeHTTP(w http.ResponseWriter, r *http.Request) { 205func (h *handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
206 submatches := re.FindStringSubmatch(r.URL.Path) 206 reqPath := os.Getenv("PATH_INFO")
207 if reqPath == "" {
208 reqPath = r.URL.Path
209 }
210 submatches := re.FindStringSubmatch(reqPath)
207 if len(submatches) != 1 { 211 if len(submatches) != 1 {
208 log("Got URL: %s", r.URL.Path) 212 log("Got URL: %s", r.URL.Path)
209 makeRespError(w, "Not found", http.StatusNotFound) 213 makeRespError(w, "Not found", http.StatusNotFound)