1
0
mirror of https://github.com/taigrr/pastebin synced 2026-04-13 19:28:05 -07:00

feat: add graceful shutdown, health endpoint, and improved client API

This commit is contained in:
2026-03-09 06:00:16 +00:00
parent ed52f9102a
commit 21bc47697b
4 changed files with 127 additions and 19 deletions

View File

@@ -353,6 +353,19 @@ func TestPasteRoundTripSpecialChars(t *testing.T) {
assert.Equal(t, specialContent, viewRec.Body.String())
}
func TestHealthzHandler(t *testing.T) {
server := newTestServer()
req := httptest.NewRequest(http.MethodGet, "/healthz", nil)
rec := httptest.NewRecorder()
server.mux.ServeHTTP(rec, req)
assert.Equal(t, http.StatusOK, rec.Code)
assert.Contains(t, rec.Header().Get("Content-Type"), "application/json")
assert.Contains(t, rec.Body.String(), `"status":"healthy"`)
}
func TestViewWithTabs(t *testing.T) {
server := newTestServer()