Add request/remote resource

This commit is contained in:
Héctor Hurtado
2020-09-09 08:53:40 +02:00
parent 9988d0e0d4
commit fc19b921be
3 changed files with 58 additions and 4 deletions
+5
View File
@@ -68,6 +68,11 @@ func getRequestPath(w http.ResponseWriter, r *http.Request, h *model.Handler) {
_, _ = w.Write([]byte(h.Request.URL.Path))
}
func getRequestRemote(w http.ResponseWriter, r *http.Request, h *model.Handler) {
w.Header().Add("Content-Type", "application/octet-stream")
_, _ = w.Write([]byte(r.RemoteAddr))
}
func getRequestMatches(w http.ResponseWriter, r *http.Request, h *model.Handler) {
w.Header().Add("Content-Type", "application/octet-stream")
name := mux.Vars(r)["name"]