aboutsummaryrefslogtreecommitdiff
path: root/lib/http/server_test.go
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2026-01-06 23:00:07 +0700
committerShulhan <ms@kilabit.info>2026-01-06 23:05:47 +0700
commite91954b5a65847970903e0d8294e54d918c8bc0b (patch)
tree95d971ce7c35fdc1d586e52ba53189ca2d88d93a /lib/http/server_test.go
parentf9567f0d4fc5cf6d0e1cea2d22289250c6b1cb2b (diff)
downloadpakakeh.go-e91954b5a65847970903e0d8294e54d918c8bc0b.tar.xz
lib/http: add second return value, statusCode, to FSHandler
Non-zero status code indicates that the function already response to the request, and the server will return immediately. Zero status code indicates that the function did not process the request, it is up to server to process the returned node `out`.
Diffstat (limited to 'lib/http/server_test.go')
-rw-r--r--lib/http/server_test.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/http/server_test.go b/lib/http/server_test.go
index a3a82d9e..6542d833 100644
--- a/lib/http/server_test.go
+++ b/lib/http/server_test.go
@@ -995,6 +995,10 @@ func TestServer_Options_HandleFS(t *testing.T) {
},
expStatusCode: http.StatusOK,
expResBody: "<html><body>Hello, /auth/sub!</body></html>\n",
+ }, {
+ desc: `With public path not exists`,
+ reqPath: `/index.php`,
+ expStatusCode: http.StatusNotFound,
}}
for _, c = range cases {
@@ -1025,7 +1029,7 @@ func TestServer_Options_HandleFS(t *testing.T) {
t.Fatalf("%s: %s", c.desc, err)
}
- test.Assert(t, "response body", c.expResBody, string(gotBody))
+ test.Assert(t, c.desc+`: response body`, c.expResBody, string(gotBody))
}
}