summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Unangst <tedu@cvs.openbsd.org>2014-07-11 22:14:40 +0000
committerTed Unangst <tedu@cvs.openbsd.org>2014-07-11 22:14:40 +0000
commitb99f900b9194b45217f6ca07e223b76e6ed3da4b (patch)
treece5aa81cb37525d5b2011cda6a7ebfdba3f9b0d3
parent501498d5feede2833c8678b6894f17dec65e6b70 (diff)
http headers must end lines with CRLF. ok schwarze
-rw-r--r--usr.bin/mandoc/cgi.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/usr.bin/mandoc/cgi.c b/usr.bin/mandoc/cgi.c
index 319832b6715..e397100983f 100644
--- a/usr.bin/mandoc/cgi.c
+++ b/usr.bin/mandoc/cgi.c
@@ -1,4 +1,4 @@
-/* $Id: cgi.c,v 1.1 2014/07/11 15:37:22 schwarze Exp $ */
+/* $Id: cgi.c,v 1.2 2014/07/11 22:14:39 tedu Exp $ */
/*
* Copyright (c) 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2014 Ingo Schwarze <schwarze@usta.de>
@@ -310,12 +310,12 @@ resp_begin_http(int code, const char *msg)
{
if (200 != code)
- printf("Status: %d %s\n", code, msg);
+ printf("Status: %d %s\r\n", code, msg);
- puts("Content-Type: text/html; charset=utf-8\n"
- "Cache-Control: no-cache\n"
- "Pragma: no-cache\n"
- "");
+ printf("Content-Type: text/html; charset=utf-8\r\n"
+ "Cache-Control: no-cache\r\n"
+ "Pragma: no-cache\r\n"
+ "\r\n");
fflush(stdout);
}
@@ -480,12 +480,13 @@ resp_search(const struct req *req, struct manpage *r, size_t sz)
* If we have just one result, then jump there now
* without any delay.
*/
- puts("Status: 303 See Other");
+ printf("Status: 303 See Other\r\n");
printf("Location: http://%s%s/show/%s/%s?",
httphost, scriptname, req->q.manpath, r[0].file);
http_printquery(req);
- puts("\n"
- "Content-Type: text/html; charset=utf-8\n");
+ printf("\r\n"
+ "Content-Type: text/html; charset=utf-8\r\n"
+ "\r\n");
return;
}