From 71a023a46a7ab8636ff3e5aa6ae42b181a6ac69d Mon Sep 17 00:00:00 2001 From: Wolfgang Draxinger Date: Tue, 10 Sep 2013 20:55:41 +0200 Subject: added support for Content-Disposition response header --- picohttp.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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); -- cgit v1.2.3