Add request/version resource

This commit is contained in:
Héctor Hurtado
2020-09-08 15:27:51 +02:00
parent 092dc741a3
commit 9988d0e0d4
3 changed files with 71 additions and 4 deletions
+5
View File
@@ -57,6 +57,11 @@ func getRequestHost(w http.ResponseWriter, r *http.Request, h *model.Handler) {
_, _ = w.Write([]byte(h.Request.Host))
}
func getRequestVersion(w http.ResponseWriter, r *http.Request, h *model.Handler) {
w.Header().Add("Content-Type", "application/octet-stream")
_, _ = w.Write([]byte(r.Proto))
}
func getRequestPath(w http.ResponseWriter, r *http.Request, h *model.Handler) {
w.Header().Add("Content-Type", "application/octet-stream")
// TODO: Discuss a how to obtain URL.EscapedPath() instead