You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

пре 9 година
1234567891011121314
  1. package middleware
  2. import "net/http"
  3. func Header(values map[string]string) func(http.Handler) http.Handler {
  4. return func(next http.Handler) http.Handler {
  5. return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
  6. for key, value := range values {
  7. w.Header().Set(key, value)
  8. }
  9. next.ServeHTTP(w, r)
  10. })
  11. }
  12. }