summary refs log tree commit diff stats
path: root/handlers.go
diff options
context:
space:
mode:
authorBen Morrison <ben@gbmor.dev>2019-05-11 00:19:24 -0400
committerBen Morrison <ben@gbmor.dev>2019-05-11 00:19:24 -0400
commitc8314846252655c7d968194f6e5d74dfc27af7da (patch)
treefd3e05bc4ae0de52ecc050c1fe8824f94e8b95e3 /handlers.go
parentae0eea0f0b2eaea22d9a87e4036ec8afa26642c3 (diff)
downloadgetwtxt-c8314846252655c7d968194f6e5d74dfc27af7da.tar.gz
reorg
Diffstat (limited to 'handlers.go')
-rw-r--r--handlers.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/handlers.go b/handlers.go
index ce33716..d57feee 100644
--- a/handlers.go
+++ b/handlers.go
@@ -8,8 +8,6 @@ import (
 	"time"
 )
 
-const textutf8 = "text/plain; charset=utf8"
-
 func validRequest(fn func(http.ResponseWriter, *http.Request, string)) http.HandlerFunc {
 	return func(w http.ResponseWriter, r *http.Request) {
 		m := confObj.validPath.FindStringSubmatch(r.URL.Path)
@@ -30,7 +28,8 @@ func apiHandler(w http.ResponseWriter, r *http.Request) {
 	etag := fmt.Sprintf("%x", sha256.Sum256(timerfc3339))
 	w.Header().Set("ETag", etag)
 	w.Header().Set("Content-Type", textutf8)
-	timerfc3339 = append(timerfc3339, byte('\n'))
+	pathdata := []byte("\n\n" + r.URL.Path)
+	timerfc3339 = append(timerfc3339, pathdata...)
 	n, err := w.Write(timerfc3339)
 	if err != nil || n == 0 {
 		log.Printf("Error writing to HTTP stream: %v\n", err)