aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWolfgang Draxinger <Wolfgang.Draxinger@physik.uni-muenchen.de>2013-07-25 14:40:15 +0200
committerWolfgang Draxinger <Wolfgang.Draxinger@physik.uni-muenchen.de>2013-07-25 14:40:15 +0200
commit00108fa372bae2e77871ac78dc63691c3f9e9abe (patch)
treeca250c3c87df8135eda6ee49a2136388a5c641a5
parent413cf79402ff29690301e886176a154f766c7551 (diff)
parentf8784d25aa8894e900451148094777ace25ab708 (diff)
downloadlitheweb-00108fa372bae2e77871ac78dc63691c3f9e9abe.tar.gz
litheweb-00108fa372bae2e77871ac78dc63691c3f9e9abe.tar.bz2
Merge branch 'devel'
-rw-r--r--picohttp.c20
-rw-r--r--test/bsdsocket.c2
2 files changed, 13 insertions, 9 deletions
diff --git a/picohttp.c b/picohttp.c
index 9b04e64..be22587 100644
--- a/picohttp.c
+++ b/picohttp.c
@@ -1039,15 +1039,17 @@ int picohttpResponseSendHeaders (
0 > (e = picohttpIO_WRITE_STATIC_STR(PICOHTTP_STR_CRLF)) )
return e;
- /* Content-Type header */
- if( 0 > (e = picohttpIO_WRITE_STATIC_STR(PICOHTTP_STR_CONTENT)) ||
- 0 > (e = picohttpIO_WRITE_STATIC_STR(PICOHTTP_STR__TYPE)) ||
- 0 > (e = picohttpIO_WRITE_STATIC_STR(PICOHTTP_STR_CLSP)) ||
- 0 > (e = picohttpIoWrite(
- req->ioops, strlen(req->response.contenttype),
- req->response.contenttype)) ||
- 0 > (e = picohttpIO_WRITE_STATIC_STR(PICOHTTP_STR_CRLF)) )
- return e;
+ if(req->response.contenttype) {
+ /* Content-Type header */
+ if( 0 > (e = picohttpIO_WRITE_STATIC_STR(PICOHTTP_STR_CONTENT)) ||
+ 0 > (e = picohttpIO_WRITE_STATIC_STR(PICOHTTP_STR__TYPE)) ||
+ 0 > (e = picohttpIO_WRITE_STATIC_STR(PICOHTTP_STR_CLSP)) ||
+ 0 > (e = picohttpIoWrite(
+ req->ioops, strlen(req->response.contenttype),
+ req->response.contenttype)) ||
+ 0 > (e = picohttpIO_WRITE_STATIC_STR(PICOHTTP_STR_CRLF)) )
+ return e;
+ }
/* Content-Length header */
if( req->response.contentlength ){
diff --git a/test/bsdsocket.c b/test/bsdsocket.c
index 5350db9..d33e5f7 100644
--- a/test/bsdsocket.c
+++ b/test/bsdsocket.c
@@ -113,6 +113,8 @@ void rhRoot(struct picohttpRequest *req)
"<label for=\"name\">Name: </label><input type=\"text\" name=\"name\"></input><br/>\n"
"<label for=\"file1\">File: </label><input type=\"file\" name=\"file1\"></input><br/>\n"
"<label for=\"file2\">File: </label><input type=\"file\" name=\"file2\"></input><br/>\n"
+"<input type=\"checkbox\" name=\"delete\" value=\"file1\"></input><br/>\n"
+"<input type=\"checkbox\" name=\"delete\" value=\"file2\"></input><br/>\n"
"<input type=\"submit\" value=\"Upload\"></input>\n"
"</form>\n"
"</body></html>\n";