Files
podinfo/pkg/api/http/headers.go
Michael Kebe 16191504d1 Removed reference to localhost from swagger
Now it is possible to use the swagger webinterface
running on a host other than localhost e.g. in docker
or kubernetes.

Removed the @host line from pkg/api/server.go and
ran make swagger.

Fixes probably #179
2024-04-09 08:54:38 +02:00

20 lines
455 B
Go

package http
import (
"net/http"
)
// Headers godoc
// @Summary Headers
// @Description returns a JSON array with the request HTTP headers
// @Tags HTTP API
// @Accept json
// @Produce json
// @Router /headers [get]
// @Success 200 {object} http.ArrayResponse
func (s *Server) echoHeadersHandler(w http.ResponseWriter, r *http.Request) {
_, span := s.tracer.Start(r.Context(), "echoHeadersHandler")
defer span.End()
s.JSONResponse(w, r, r.Header)
}