~sircmpwn/searchhut-devel

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
1

[PATCH] web: answer HEAD requests

Details
Message ID
<20220714194447.11722-1-umar@handlerug.me>
DKIM signature
missing
Download raw message
Patch: +10 -1
Fixes: https://todo.sr.ht/~sircmpwn/searchhut/42
---
 cmd/sh-web/main.go | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/cmd/sh-web/main.go b/cmd/sh-web/main.go
index 6488359..235e9ef 100644
--- a/cmd/sh-web/main.go
+++ b/cmd/sh-web/main.go
@@ -37,6 +37,15 @@ type AboutPage struct {
	CrawlerUA string
}

type router struct {
	*chi.Mux
}

func (r *router) Get(pattern string, handlerFn http.HandlerFunc) {
	r.Mux.Get(pattern, handlerFn)
	r.Mux.Head(pattern, handlerFn)
}

func main() {
	conf := config.Load()
	port, ok := conf.Get("searchhut::web", "bind")
@@ -44,7 +53,7 @@ func main() {
		port = ":8081"
	}

	router := chi.NewRouter()
	router := router{chi.NewRouter()}
	router.Use(middleware.RealIP)
	router.Use(middleware.Logger)
	router.Use(middleware.Timeout(10 * time.Second))
-- 
2.32.1 (Apple Git-133)
Details
Message ID
<CLG1FYYINB18.1M0C35RPDUZRK@taiga>
In-Reply-To
<20220714194447.11722-1-umar@handlerug.me> (view parent)
DKIM signature
missing
Download raw message
Thanks!

To git@git.sr.ht:~sircmpwn/searchhut
   562fecf..2b6407e  master -> master
Reply to thread Export thread (mbox)