]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Add \r\n to remaining http headers passed to ast_http_send
authorTerry Wilson <twilson@digium.com>
Thu, 10 Mar 2011 16:05:45 +0000 (16:05 +0000)
committerTerry Wilson <twilson@digium.com>
Thu, 10 Mar 2011 16:05:45 +0000 (16:05 +0000)
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/branches/1.8@310240 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/manager.c
res/res_phoneprov.c

index 5c305f5445f652f89e2f65c598465a48f44b5b98..d759efd908130945465d9677d2eb32a93fbf13c0 100644 (file)
@@ -5839,7 +5839,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, "<ajax-response>\n");
index e969bc402b36359be00dc829df63fb09685b6f4d..24d7b650512c5661591fd9becf883c70679dbabf 100644 (file)
@@ -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))) {