diff options
| author | saturneric <[email protected]> | 2025-11-08 13:19:44 +0000 |
|---|---|---|
| committer | saturneric <[email protected]> | 2025-11-08 13:19:44 +0000 |
| commit | 276211d3e9e1230b40517c0ee87efef25fd20fee (patch) | |
| tree | a9f1a210a383b21311c66c61a51b117f6c05c690 | |
| parent | fix(ui): normalize clone URLs to lowercase (diff) | |
| download | cgit-276211d3e9e1230b40517c0ee87efef25fd20fee.tar.gz cgit-276211d3e9e1230b40517c0ee87efef25fd20fee.zip | |
fix(proxy): broaden git URL matching for proxy
* Expand URL regex to support proxying requests for repositories
lacking `.git` suffix, except for `cgit.cgi`
* Restrict allowed methods to `GET` and `POST` for these requests
* Improve compatibility with varied git client request patterns
| -rw-r--r-- | lighttpd.conf | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lighttpd.conf b/lighttpd.conf index 34cef44..4dc0b11 100644 --- a/lighttpd.conf +++ b/lighttpd.conf @@ -11,12 +11,11 @@ mimetype.assign = ( ".css" => "text/css" ) # accesslog.format = "%h %V %u %t \"%r\" %s %b \"%{Referer}i\" \"%{User-Agent}i\" %T" # Proxy git http requests to gitea -$HTTP["url"] =~ "^/(.+?)\.git/(info/refs|git-upload-pack)$" { - # Only allow GET and POST methods +$HTTP["url"] =~ "^/(?!cgit\.cgi)(.+?)(?:\.git)?/(info/refs|git-upload-pack)$" { + # only allow GET/POST methods $HTTP["request-method"] !~ "^(GET|POST)$" { - url.access-deny = ("") + url.access-deny = ( "" ) } - # Proxy to gitea server proxy.server = ( "" => (( "host" => "gitea", |
