Add route/id resource. Closes #10

This commit is contained in:
Héctor Hurtado
2020-09-09 13:27:30 +02:00
parent 774b9202b5
commit 6c3bee9ae0
4 changed files with 87 additions and 8 deletions
+6
View File
@@ -156,6 +156,12 @@ func getRequestFileContent(w http.ResponseWriter, r *http.Request, h *model.Hand
}
}
func getRequestId(w http.ResponseWriter, r *http.Request, h *model.Handler) {
w.Header().Add("Content-Type", "application/octet-stream")
_, _ = w.Write([]byte(h.Route.ID))
}
// FIXME: Allow any HTTP status code. Now we are limited by WriteHeader
// capabilities
func setResponseStatus(w http.ResponseWriter, r *http.Request, h *model.Handler) {