mirror of
https://github.com/stefanprodan/podinfo.git
synced 2026-04-02 00:56:53 +00:00
20 lines
453 B
Go
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)
|
|
}
|