diff options
author | Ben Morrison <ben@gbmor.dev> | 2019-05-11 00:19:24 -0400 |
---|---|---|
committer | Ben Morrison <ben@gbmor.dev> | 2019-05-11 00:19:24 -0400 |
commit | c8314846252655c7d968194f6e5d74dfc27af7da (patch) | |
tree | fd3e05bc4ae0de52ecc050c1fe8824f94e8b95e3 /handlers.go | |
parent | ae0eea0f0b2eaea22d9a87e4036ec8afa26642c3 (diff) | |
download | getwtxt-c8314846252655c7d968194f6e5d74dfc27af7da.tar.gz |
reorg
Diffstat (limited to 'handlers.go')
-rw-r--r-- | handlers.go | 5 |
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) |