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) {
: John Keeping <john@keeping.me.uk> 2013-03-20cgit.mk: don't rebuild everything if CGIT_VERSION changesJohn Keeping If CGIT_VERSION is in CGIT_CFLAGS then a change in version (for example because you have committed your changes) causes all of the CGit objects to be rebuilt. Avoid this by using EXTRA_CPPFLAGS to add the version for only those files that are affected and make them depend on VERSION. Signed-off-by: John Keeping <john@keeping.me.uk> 2013-03-20ui-patch: use cgit_version not CGIT_VERSIONJohn Keeping We already have a global cgit_version which is set from the #define'd CGIT_VERSION in cgit.c. Change ui-patch.c to use this so that we only need to rebuild cgit.o when the version changes. Signed-off-by: John Keeping <john@keeping.me.uk> 2013-03-20Makefile: re-use Git's Makefile where possibleJohn Keeping