aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWolfgang Draxinger <Wolfgang.Draxinger@physik.uni-muenchen.de>2013-09-10 20:55:41 +0200
committerWolfgang Draxinger <Wolfgang.Draxinger@physik.uni-muenchen.de>2013-09-10 20:55:41 +0200
commit71a023a46a7ab8636ff3e5aa6ae42b181a6ac69d (patch)
treeb2398a30522ddd22e520ff78a4a00e3f4af34d8f
parent7f58ba9f11f131f165bd29575f93a50d9dc26c06 (diff)
downloadlitheweb-71a023a46a7ab8636ff3e5aa6ae42b181a6ac69d.tar.gz
litheweb-71a023a46a7ab8636ff3e5aa6ae42b181a6ac69d.tar.bz2
added support for Content-Disposition response header
-rw-r--r--picohttp.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/picohttp.c b/picohttp.c
index 58973bc..92b0996 100644
--- a/picohttp.c
+++ b/picohttp.c
@@ -1053,6 +1053,18 @@ int picohttpResponseSendHeaders (
return e;
}
+ if(req->response.disposition) {
+ /* Content-Type header */
+ if( 0 > (e = picohttpIO_WRITE_STATIC_STR(PICOHTTP_STR_CONTENT)) ||
+ 0 > (e = picohttpIO_WRITE_STATIC_STR(PICOHTTP_STR__DISPOSITION)) ||
+ 0 > (e = picohttpIO_WRITE_STATIC_STR(PICOHTTP_STR_CLSP)) ||
+ 0 > (e = picohttpIoWrite(
+ req->ioops, strlen(req->response.disposition),
+ req->response.disposition)) ||
+ 0 > (e = picohttpIO_WRITE_STATIC_STR(PICOHTTP_STR_CRLF)) )
+ return e;
+ }
+
/* Content-Length header */
if( req->response.contentlength ){
p = picohttp_fmt_uint(tmp, req->response.contentlength);