diff options
author | 2014-07-11 22:14:39 +0000 | |
---|---|---|
committer | 2014-07-11 22:14:39 +0000 | |
commit | fa9c540a03496b4c85a8d326271415d54a61ba99 (patch) | |
tree | 142e0f3aff5b95c0d11e87f7087119924ab7e524 /usr.bin/mandoc/cgi.c | |
parent | Let us hurry. There is nothing to fear here. (diff) | |
download | wireguard-openbsd-fa9c540a03496b4c85a8d326271415d54a61ba99.tar.xz wireguard-openbsd-fa9c540a03496b4c85a8d326271415d54a61ba99.zip |
http headers must end lines with CRLF. ok schwarze
Diffstat (limited to 'usr.bin/mandoc/cgi.c')
-rw-r--r-- | usr.bin/mandoc/cgi.c | 19 |
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; } |