aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/cgi.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2014-07-11 22:25:44 +0000
committerIngo Schwarze <schwarze@openbsd.org>2014-07-11 22:25:44 +0000
commit4b76154b7131ec34af18f3cfc651d8d710fbf23e (patch)
treef5a5e60aebb02b47095094f17d165e335f26e53e /cgi.c
parentc3cb3f8f5ed4d3ce7529c67b6ad76d21e99ddbd8 (diff)
downloadmandoc-4b76154b7131ec34af18f3cfc651d8d710fbf23e.tar.gz
mandoc-4b76154b7131ec34af18f3cfc651d8d710fbf23e.tar.zst
mandoc-4b76154b7131ec34af18f3cfc651d8d710fbf23e.zip
merge OpenBSD rev. 1.2 by tedu@:
http headers must end lines with CRLF.
Diffstat (limited to 'cgi.c')
-rw-r--r--cgi.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/cgi.c b/cgi.c
index 284e4883..c344943c 100644
--- a/cgi.c
+++ b/cgi.c
@@ -1,4 +1,4 @@
-/* $Id: cgi.c,v 1.61 2014/07/10 00:52:50 schwarze Exp $ */
+/* $Id: cgi.c,v 1.62 2014/07/11 22:25:44 schwarze Exp $ */
/*
* Copyright (c) 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2014 Ingo Schwarze <schwarze@usta.de>
@@ -314,12 +314,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);
}
@@ -484,12 +484,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;
}