diff options
author | Wolfgang Draxinger <Wolfgang.Draxinger@physik.uni-muenchen.de> | 2013-07-25 14:40:15 +0200 |
---|---|---|
committer | Wolfgang Draxinger <Wolfgang.Draxinger@physik.uni-muenchen.de> | 2013-07-25 14:40:15 +0200 |
commit | 00108fa372bae2e77871ac78dc63691c3f9e9abe (patch) | |
tree | ca250c3c87df8135eda6ee49a2136388a5c641a5 /picohttp.c | |
parent | 413cf79402ff29690301e886176a154f766c7551 (diff) | |
parent | f8784d25aa8894e900451148094777ace25ab708 (diff) | |
download | litheweb-00108fa372bae2e77871ac78dc63691c3f9e9abe.tar.gz litheweb-00108fa372bae2e77871ac78dc63691c3f9e9abe.tar.bz2 |
Merge branch 'devel'
Diffstat (limited to 'picohttp.c')
-rw-r--r-- | picohttp.c | 20 |
1 files changed, 11 insertions, 9 deletions
@@ -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 ){ |