diff options
| author | Rutger Broekhoff | 2023-12-29 23:25:25 +0100 |
|---|---|---|
| committer | Rutger Broekhoff | 2023-12-29 23:25:25 +0100 |
| commit | fe3e8c4d02c3ab9528a10b93c3f401f938895a30 (patch) | |
| tree | da12e9c36c0d9be580cfd9cd0ece5c865697df1e /cmd/git-lfs-server | |
| parent | 1ba17990d3bf73205f7829493bcf691724092240 (diff) | |
| download | gitolfs3-fe3e8c4d02c3ab9528a10b93c3f401f938895a30.tar.gz gitolfs3-fe3e8c4d02c3ab9528a10b93c3f401f938895a30.zip | |
Prefer PATH_INFO over request URL
Diffstat (limited to 'cmd/git-lfs-server')
| -rw-r--r-- | cmd/git-lfs-server/main.go | 6 |
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 | ||
| 205 | func (h *handler) ServeHTTP(w http.ResponseWriter, r *http.Request) { | 205 | func (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) |