summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-07-16 14:35:15 -0400
committerJune McEnroe <june@causal.agency>2020-07-16 14:35:15 -0400
commitd1a846d5887bf72ca6133b8bbaeea35e8e980b55 (patch)
tree83078e8af6cd829d9adf649ffd267a2bb0b7b901
parentFactor out search page URLs (diff)
downloadscooper-d1a846d5887bf72ca6133b8bbaeea35e8e980b55.tar.gz
scooper-d1a846d5887bf72ca6133b8bbaeea35e8e980b55.zip
Handle HEAD for stylesheet
Diffstat (limited to '')
-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) {
>2020-10-07Use mandoc -T utf8 for text.June McEnroe 2020-09-20Add The Awakened KingdomJune McEnroe 2020-09-12Move /opt/local back, cheat port select to use system manJune McEnroe 2020-09-12Move /opt/local behind /usr againJune McEnroe 2020-09-12Enable toc in cgit renderings of man pagesJune McEnroe 2020-09-11Install mandoc on macOSJune McEnroe 2020-09-11Rewrite install script yet againJune McEnroe 2020-09-11Remove NetBSD from install scriptJune McEnroe 2020-09-11Use MacPorts rather than pkgsrcJune McEnroe 2020-09-11Add debian VM name to sshJune McEnroe 2020-09-11Add influencer tweetJune McEnroe 2020-09-10Add The Kingdom of GodsJune McEnroe 2020-09-07Add SunglassesJune McEnroe 2020-09-06Add Between the BreathsJune McEnroe 2020-09-04Open /dev/tty in nudgeJune McEnroe 2020-09-04Add nudgeJune McEnroe 2020-09-03Build fbclock with -lzJune McEnroe 2020-08-29Add tweets from retweetsJune McEnroe