Files
podinfo/pkg/api/headers.go
2021-12-16 12:39:10 +00:00

20 lines
453 B
Go

package api
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} api.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)
}