X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=src%2Fzgdu.c;h=0dfdbafd8218c54ac19dffa9b9cc35f7f66d7e85;hp=88c92a50b4c139ea3a30c0378e42dafc1918ac4e;hb=1f3fe256d54ab81d998cd622abda89580cc0b3ff;hpb=7816498d590a66569e6ca8d17e8a4a3723a36826 diff --git a/src/zgdu.c b/src/zgdu.c index 88c92a5..0dfdbaf 100644 --- a/src/zgdu.c +++ b/src/zgdu.c @@ -2,7 +2,7 @@ * Copyright (C) 1995-2005, Index Data ApS * See the file LICENSE for details. * - * $Id: zgdu.c,v 1.13 2005-06-25 15:46:06 adam Exp $ + * $Id: zgdu.c,v 1.14 2006-03-01 23:24:25 adam Exp $ */ /** @@ -152,6 +152,22 @@ static int decode_headers_content(ODR o, int off, Z_HTTP_Header **headers, return 1; } +void z_HTTP_header_add_content_type(ODR o, Z_HTTP_Header **hp, + const char *content_type, + const char *charset) +{ + const char *l = "Content-Type"; + if (charset) + { + char *ctype = odr_malloc(o, strlen(content_type)+strlen(charset) + 15); + sprintf(ctype, "%s; charset=%s", content_type, charset); + z_HTTP_header_add(o, hp, l, ctype); + } + else + z_HTTP_header_add(o, hp, l, content_type); + +} + void z_HTTP_header_add(ODR o, Z_HTTP_Header **hp, const char *n, const char *v) {