mirror of
https://github.com/stefanprodan/podinfo.git
synced 2026-04-06 11:06:50 +00:00
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
20 lines
455 B
Go
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)
|
|
}
|