diff options
Diffstat (limited to 'main/http.c')
-rw-r--r-- | main/http.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/main/http.c b/main/http.c index cc32b9422..63d91c2b2 100644 --- a/main/http.c +++ b/main/http.c @@ -134,7 +134,7 @@ static AST_RWLIST_HEAD_STATIC(uri_redirects, http_uri_redirect); static const struct ast_cfhttp_methods_text { enum ast_http_method method; - const char text[]; + const char *text; } ast_http_methods_text[] = { { AST_HTTP_UNKNOWN, "UNKNOWN" }, { AST_HTTP_GET, "GET" }, @@ -145,7 +145,15 @@ static const struct ast_cfhttp_methods_text { const char *ast_get_http_method(enum ast_http_method method) { - return ast_http_methods_text[method].text; + int x; + + for (x = 0; x < ARRAY_LEN(ast_http_methods_text); x++) { + if (ast_http_methods_text[x].method == method) { + return ast_http_methods_text[x].text; + } + } + + return NULL; } const char *ast_http_ftype2mtype(const char *ftype) |