about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--server.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/server.c b/server.c
index 0ed1c9c..96acad7 100644
--- a/server.c
+++ b/server.c
@@ -54,13 +54,15 @@ const struct kvalid Keys[KeysLen] = {
 
 static enum kcgi_err stylesheet(struct kreq *req) {
 	if (req->mime != KMIME_TEXT_CSS) return httpFail(req, KHTTP_404);
-	return httpHead(req, KHTTP_200, KMIME_TEXT_CSS)
+	enum kcgi_err error = 0
+		|| httpHead(req, KHTTP_200, KMIME_TEXT_CSS)
 		|| khttp_head(
 			req, kresps[KRESP_CACHE_CONTROL],
 			"public, max-age=86400, immutable"
 		)
-		|| khttp_body(req)
-		|| khttp_write(req, CSS, sizeof(CSS));
+		|| khttp_body(req);
+	if (req->method == KMETHOD_HEAD) return error;
+	return error || khttp_write(req, CSS, sizeof(CSS));
 }
 
 static enum kcgi_err dispatch(struct kreq *req) {