Index: main/http.c =================================================================== --- main/http.c (revision 110540) +++ main/http.c (working copy) @@ -187,7 +187,7 @@ /* Cap maximum length */ if ((len = strlen(uri) + strlen(ast_config_AST_DATA_DIR) + strlen("/static-http/") + 5)) { - goto out403; + // goto out403; } path = alloca(len); @@ -286,6 +286,7 @@ .description = "Asterisk HTTP General Status", .uri = "httpstatus", .supports_get = 1, + .supports_post = 1, }; static struct ast_http_uri staticuri = { @@ -295,6 +296,7 @@ .has_subtree = 1, .static_content = 1, .supports_get = 1, + .supports_post = 1, }; struct ast_str *ast_http_error(int status, const char *title, const char *extra_header, const char *text) @@ -623,7 +625,7 @@ int saw_method = 0; /* preserve previous behavior of only support URI parameters on GET requests */ - if (method == AST_HTTP_GET) { + if (method == AST_HTTP_POST) { strsep(¶ms, "?"); /* Extract arguments from the request and store them in variables. */ @@ -706,7 +708,6 @@ l = strlen(urih->uri); c = uri + l; /* candidate */ - if (strncasecmp(urih->uri, uri, l) || /* no match */ (*c && *c != '/')) { /* substring */ continue; @@ -716,11 +717,12 @@ c++; } - if (!*c || urih->has_subtree) { + l = strlen(c); + if (!l || urih->has_subtree) { if (((method == AST_HTTP_GET) && urih->supports_get) || - ((method == AST_HTTP_POST) && urih->supports_post)) { - uri = c; - + ((method == AST_HTTP_POST) && urih->supports_post)) { + if (l) + uri = c; break; } } @@ -731,6 +733,7 @@ } } + if (urih) { *static_content = urih->static_content; out = urih->callback(ser, uri, method, vars, status, title, contentlength); @@ -1179,6 +1182,9 @@ if (enabled) { http_desc.sin.sin_family = https_desc.sin.sin_family = AF_INET; } + if (ast_strlen_zero(newprefix)){ + ast_copy_string(newprefix, "/asterisk", 10 ); + } if (strcmp(prefix, newprefix)) { ast_copy_string(prefix, newprefix, sizeof(prefix)); }