From 0189688588a4cec8042ec386904fdf7ec5ab766b Mon Sep 17 00:00:00 2001 From: Amir Zarrinkafsh Date: Sat, 11 Apr 2020 12:14:26 +1000 Subject: [PATCH] [MISC] Allow HEAD method on /api/verify (#850) This is to natively support the upstream HAProxy module haproxy-auth-request without patching. --- internal/server/server.go | 1 + internal/suites/example/compose/haproxy/Dockerfile | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/server/server.go b/internal/server/server.go index f9d4208e5..9a6a4b7f9 100644 --- a/internal/server/server.go +++ b/internal/server/server.go @@ -38,6 +38,7 @@ func StartServer(configuration schema.Configuration, providers middlewares.Provi middlewares.RequireFirstFactor(handlers.ExtendedConfigurationGet))) router.GET("/api/verify", autheliaMiddleware(handlers.VerifyGet)) + router.HEAD("/api/verify", autheliaMiddleware(handlers.VerifyGet)) router.POST("/api/firstfactor", autheliaMiddleware(handlers.FirstFactorPost)) router.POST("/api/logout", autheliaMiddleware(handlers.LogoutPost)) diff --git a/internal/suites/example/compose/haproxy/Dockerfile b/internal/suites/example/compose/haproxy/Dockerfile index 56b928823..b5f52ebd0 100644 --- a/internal/suites/example/compose/haproxy/Dockerfile +++ b/internal/suites/example/compose/haproxy/Dockerfile @@ -6,6 +6,5 @@ apk add --no-cache \ lua5.3-socket \ openssl && \ curl -Lfs -o /usr/local/etc/haproxy/auth-request.lua "https://raw.githubusercontent.com/TimWolla/haproxy-auth-request/master/auth-request.lua" && \ -sed -i 's/HEAD/GET/g' /usr/local/etc/haproxy/auth-request.lua && \ openssl req -new -newkey rsa:4096 -days 365 -nodes -x509 -subj "/C=AU/ST=Victoria/L=Melbourne/O=Authelia/CN=*.example.com" -keyout haproxy.key -out haproxy.crt && \ cat haproxy.key haproxy.crt > /usr/local/etc/haproxy/haproxy.pem \ No newline at end of file