Respond to HEAD requests.

This commit is contained in:
Catherine
2025-09-15 11:28:33 +00:00
parent 9346beb01b
commit 9588e6743c
2 changed files with 2 additions and 2 deletions

View File

@@ -9,7 +9,7 @@ Features
* In response to a `PUT` or `POST` request, performs a shallow in-memory clone of a git repository, checks out a tree to the filesystem, and atomically updates the version of content being served.
- `PUT` method is a custom REST endpoint, `POST` method is a Forgejo webhook endpoint.
* In response to a `GET` request, selects an appropriate tree and serves files from it. Supported URL patterns:
* In response to a `GET` or `HEAD` request, selects an appropriate tree and serves files from it. Supported URL patterns:
- `https://domain.tld/project/` (routed to project-specific tree)
- `https://domain.tld/` (routed to domain-specific tree by exclusion)

View File

@@ -237,7 +237,7 @@ func ServePages(w http.ResponseWriter, r *http.Request) {
log.Println("pages:", r.Method, r.Host, r.URL)
err := error(nil)
switch r.Method {
case http.MethodGet:
case http.MethodGet, http.MethodHead:
err = getPage(w, r)
case http.MethodPut:
err = putPage(w, r)