func (bamw *BasicAuthMw) unauthorized(writer rest.ResponseWriter) { writer.Header().Set("WWW-Authenticate", "Basic realm="+bamw.Realm) rest.Error(writer, "Not Authorized", http.StatusUnauthorized) }