|
|
@ -451,6 +451,7 @@ static struct ast_str *handle_uri(struct ast_tcptls_session_instance *ser, char
|
|
|
|
/* scan registered uris to see if we match one. */
|
|
|
|
/* scan registered uris to see if we match one. */
|
|
|
|
AST_RWLIST_RDLOCK(&uris);
|
|
|
|
AST_RWLIST_RDLOCK(&uris);
|
|
|
|
AST_RWLIST_TRAVERSE(&uris, urih, entry) {
|
|
|
|
AST_RWLIST_TRAVERSE(&uris, urih, entry) {
|
|
|
|
|
|
|
|
ast_debug(2, "match request [%s] with handler [%s] len %d\n", uri, urih->uri, l);
|
|
|
|
if (!saw_method) {
|
|
|
|
if (!saw_method) {
|
|
|
|
switch (method) {
|
|
|
|
switch (method) {
|
|
|
|
case AST_HTTP_GET:
|
|
|
|
case AST_HTTP_GET:
|
|
|
@ -632,34 +633,10 @@ static void *httpd_helper_thread(void *data)
|
|
|
|
if (ast_strlen_zero(cookie)) {
|
|
|
|
if (ast_strlen_zero(cookie)) {
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (strncasecmp(cookie, "Cookie: ", 8)) {
|
|
|
|
if (!strncasecmp(cookie, "Cookie: ", 8)) {
|
|
|
|
char *name, *value;
|
|
|
|
|
|
|
|
struct ast_variable *var;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
value = ast_strdupa(cookie);
|
|
|
|
|
|
|
|
name = strsep(&value, ":");
|
|
|
|
|
|
|
|
if (!value) {
|
|
|
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
value = ast_skip_blanks(value);
|
|
|
|
|
|
|
|
if (ast_strlen_zero(value)) {
|
|
|
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
var = ast_variable_new(name, value, "");
|
|
|
|
|
|
|
|
if (!var) {
|
|
|
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
var->next = headers;
|
|
|
|
|
|
|
|
headers = var;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (vars) {
|
|
|
|
|
|
|
|
ast_variables_destroy(vars);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
vars = parse_cookies(cookie);
|
|
|
|
vars = parse_cookies(cookie);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!*uri) {
|
|
|
|
if (!*uri) {
|
|
|
|
out = ast_http_error(400, "Bad Request", NULL, "Invalid Request");
|
|
|
|
out = ast_http_error(400, "Bad Request", NULL, "Invalid Request");
|
|
|
|