diff options
author | Ben Morrison <ben@gbmor.dev> | 2019-06-09 15:00:02 -0400 |
---|---|---|
committer | Ben Morrison <ben@gbmor.dev> | 2019-06-09 15:25:05 -0400 |
commit | a9d7d114e9ed0b5b4157a13b9a90e175f2785584 (patch) | |
tree | b16dfbee0906324133a382ea2aa04235b631d7b1 /svc/handlers.go | |
parent | 2fd6b1aaa6b8382fabf1361259188f4ef36472d3 (diff) | |
download | getwtxt-a9d7d114e9ed0b5b4157a13b9a90e175f2785584.tar.gz |
apiEndpointHandler now 404s invalid endpoints, better testing for it
Diffstat (limited to 'svc/handlers.go')
-rw-r--r-- | svc/handlers.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/svc/handlers.go b/svc/handlers.go index 5bb0d4f..02975ef 100644 --- a/svc/handlers.go +++ b/svc/handlers.go @@ -133,9 +133,13 @@ func apiEndpointHandler(w http.ResponseWriter, r *http.Request) { out, err = twtxtCache.QueryInStatus("@<") out = registry.ReduceToPage(page, out) - default: + case "/api/plain/tweets": out, err = twtxtCache.QueryAllStatuses() out = registry.ReduceToPage(page, out) + + default: + log404(w, r, fmt.Errorf("endpoint not found")) + return } errLog("", err) |