aboutsummaryrefslogtreecommitdiff
path: root/picohttp.c
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 /picohttp.c
parent413cf79402ff29690301e886176a154f766c7551 (diff)
parentf8784d25aa8894e900451148094777ace25ab708 (diff)
downloadlitheweb-00108fa372bae2e77871ac78dc63691c3f9e9abe.tar.gz
litheweb-00108fa372bae2e77871ac78dc63691c3f9e9abe.tar.bz2
Merge branch 'devel'
Diffstat (limited to 'picohttp.c')
-rw-r--r--picohttp.c20
1 files changed, 11 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 ){