ingress-nginx-helm/docs/examples/customization/external-auth-headers/echosvc/echosvc.go
Manuel de Brito Fontes a9168f276e Split documentation
2017-10-13 18:13:51 -03:00

16 lines
357 B
Go

package main
import (
"fmt"
"net/http"
)
func handler(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "UserID: %s, UserRole: %s", r.Header.Get("UserID"), r.Header.Get("UserRole"))
}
// Sample "echo" service displaying UserID and UserRole HTTP request headers
func main() {
http.HandleFunc("/", handler)
http.ListenAndServe(":8080", nil)
}