From 254092f8f6fb1567d54b730a12398667bf3577de Mon Sep 17 00:00:00 2001 From: Terry Wilson Date: Thu, 10 Mar 2011 16:09:09 +0000 Subject: [PATCH] Merged revisions 310240 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r310240 | twilson | 2011-03-10 10:05:45 -0600 (Thu, 10 Mar 2011) | 13 lines Add \r\n to remaining http headers passed to ast_http_send r309204 changed the behavior of ast_http_send. It now requires headers to be passed with trailing \r\n. This change updates the remaining instances in the code that did not pass the \r\n. (closes issue #18186) Reported by: nivaldomjunior Patches: res_phoneprov.c.diff uploaded by lathama (license 1028) manager.diff.txt uploaded by twilson (license 396) Tested by: lathama ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@310241 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- main/manager.c | 2 +- res/res_phoneprov.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/main/manager.c b/main/manager.c index 1b0ce8897f..f69f3fad8d 100644 --- a/main/manager.c +++ b/main/manager.c @@ -5852,7 +5852,7 @@ static int auth_http_callback(struct ast_tcptls_session_instance *ser, goto auth_callback_out; } - ast_str_append(&http_header, 0, "Content-type: text/%s", contenttype[format]); + ast_str_append(&http_header, 0, "Content-type: text/%s\r\n", contenttype[format]); if (format == FORMAT_XML) { ast_str_append(&out, 0, "\n"); diff --git a/res/res_phoneprov.c b/res/res_phoneprov.c index e969bc402b..24d7b65051 100644 --- a/res/res_phoneprov.c +++ b/res/res_phoneprov.c @@ -440,7 +440,7 @@ static int phoneprov_callback(struct ast_tcptls_session_instance *ser, const str } http_header = ast_str_create(80); - ast_str_set(&http_header, 0, "Content-type: %s", + ast_str_set(&http_header, 0, "Content-type: %s\r\n", route->file->mime_type); ast_http_send(ser, method, 200, NULL, http_header, NULL, fd, 0); @@ -504,7 +504,7 @@ static int phoneprov_callback(struct ast_tcptls_session_instance *ser, const str } http_header = ast_str_create(80); - ast_str_set(&http_header, 0, "Content-type: %s", + ast_str_set(&http_header, 0, "Content-type: %s\r\n", route->file->mime_type); if (!(result = ast_str_create(512))) {