summaryrefslogtreecommitdiff
path: root/res/res_ari.c
diff options
context:
space:
mode:
authorSean Bright <sean.bright@gmail.com>2016-05-14 13:29:09 -0400
committerSean Bright <sean.bright@gmail.com>2016-05-14 12:48:59 -0500
commit14938184a38bd76b0b7bf04d583bbc1c2933407d (patch)
treeb649369942d7f9eb1dc30684ba0070374eee1dab /res/res_ari.c
parentd9c5882e69e28c11e6de82329f6d9a9bd40d7dc0 (diff)
res_ari: Correct Location headers returned by some ARI resources
The Location headers returned by: * /bridges/{bridgeId}/play * /bridges/{bridgeId}/record * /channels/{channelId}/play * /channels/{channelId}/record Did not have the '/ari' prefix, and in the case of the 'play' resources, were using 'playback' instead of 'playbacks.' Change-Id: I957c58a3a1471bf477dae7c67faa1b74fcd9241c
Diffstat (limited to 'res/res_ari.c')
-rw-r--r--res/res_ari.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/res/res_ari.c b/res/res_ari.c
index 62083bfb1..14dece8e4 100644
--- a/res/res_ari.c
+++ b/res/res_ari.c
@@ -304,10 +304,11 @@ void ast_ari_response_alloc_failed(struct ast_ari_response *response)
void ast_ari_response_created(struct ast_ari_response *response,
const char *url, struct ast_json *message)
{
+ RAII_VAR(struct stasis_rest_handlers *, root, get_root_handler(), ao2_cleanup);
response->message = message;
response->response_code = 201;
response->response_text = "Created";
- ast_str_append(&response->headers, 0, "Location: %s\r\n", url);
+ ast_str_append(&response->headers, 0, "Location: /%s%s\r\n", root->path_segment, url);
}
static void add_allow_header(struct stasis_rest_handlers *handler,