diff --git a/miniupnpd/Changelog.txt b/miniupnpd/Changelog.txt index bdd7a78..38cf786 100644 --- a/miniupnpd/Changelog.txt +++ b/miniupnpd/Changelog.txt @@ -6,6 +6,7 @@ $Id: Changelog.txt,v 1.309 2012/09/27 16:01:10 nanard Exp $ UPC must be a 12 decimal digit code SetDefaultConnectionService() checks its argumnents in UPNP_STRICT mode Support for Accept-Language/Content-Language HTTP headers + Content-Type is now text/xml; charset="utf-8" to conform with UDA v1.1 2012/09/20: Cleaning code in ipfw (Jardel Weyrich) diff --git a/miniupnpd/upnphttp.c b/miniupnpd/upnphttp.c index befc8a1..119ed46 100644 --- a/miniupnpd/upnphttp.c +++ b/miniupnpd/upnphttp.c @@ -655,7 +655,6 @@ Process_upnphttp(struct upnphttp * h) static const char httpresphead[] = "%s %d %s\r\n" - /*"Content-Type: text/xml; charset=\"utf-8\"\r\n"*/ "Content-Type: %s\r\n" "Connection: close\r\n" "Content-Length: %d\r\n" @@ -690,11 +689,14 @@ BuildHeader_upnphttp(struct upnphttp * h, int respcode, } h->res_buf_alloclen = templen; } + h->res_sent = 0; h->res_buflen = snprintf(h->res_buf, h->res_buf_alloclen, httpresphead, h->HttpVer, respcode, respmsg, - (h->respflags&FLAG_HTML)?"text/html":"text/xml", + (h->respflags&FLAG_HTML)?"text/html":"text/xml; charset=\"utf-8\"", bodylen); + /* Content-Type MUST be 'text/xml; charset="utf-8"' according to UDA v1.1 */ + /* Content-Type MUST be 'text/xml' according to UDA v1.0 */ /* Additional headers */ #ifdef ENABLE_EVENTS if(h->respflags & FLAG_TIMEOUT) {