From 447109e868fba82488ff3ea2677216a2d680c9a5 Mon Sep 17 00:00:00 2001 From: Martin Baillie Date: Sun, 18 Jun 2017 13:03:48 +1000 Subject: [PATCH] Add HTTP HEAD handling to /ping endpoint Also updates documentation to reflect new method. --- docs/toml.md | 2 +- server/web.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/toml.md b/docs/toml.md index 0df944620..917a1336e 100644 --- a/docs/toml.md +++ b/docs/toml.md @@ -649,7 +649,7 @@ address = ":8080" ![Web UI Providers](img/web.frontend.png) ![Web UI Health](img/traefik-health.png) -- `/ping`: `GET` simple endpoint to check for Træfik process liveness. +- `/ping`: A simple endpoint to check for Træfik process liveness. Supports HTTP `GET` and `HEAD` requests. ```shell $ curl -sv "http://localhost:8080/ping" diff --git a/server/web.go b/server/web.go index 92b3a228f..89c27db07 100644 --- a/server/web.go +++ b/server/web.go @@ -83,7 +83,7 @@ func (provider *WebProvider) Provide(configurationChan chan<- types.ConfigMessag systemRouter.Methods("GET").Path(provider.Path + "health").HandlerFunc(provider.getHealthHandler) // ping route - systemRouter.Methods("GET").Path(provider.Path + "ping").HandlerFunc(provider.getPingHandler) + systemRouter.Methods("GET", "HEAD").Path(provider.Path + "ping").HandlerFunc(provider.getPingHandler) // API routes systemRouter.Methods("GET").Path(provider.Path + "api").HandlerFunc(provider.getConfigHandler) systemRouter.Methods("GET").Path(provider.Path + "api/version").HandlerFunc(provider.getVersionHandler)