diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-04-11 14:49:07 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-04-11 14:49:07 +0000 |
commit | 62012043fb6d9db9588a9083d23f5edda5e67ce4 (patch) | |
tree | 1f01e1e839a18d403ff381e5c0b2021b647f70c2 | |
parent | 56b0849bcc9f6ecb642b23aa7a6b7be7605afcd4 (diff) |
Merged revisions 61407 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r61407 | russell | 2007-04-11 09:48:01 -0500 (Wed, 11 Apr 2007) | 4 lines
Add "svgz" to the mimetypes table. (issue #9510, bkruse)
In passing, constify the elements of the mimetypes table.
........
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@61410 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r-- | main/http.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/main/http.c b/main/http.c index 7d33fc970..5de435131 100644 --- a/main/http.c +++ b/main/http.c @@ -111,8 +111,8 @@ static int enablestatic; /*! \brief Limit the kinds of files we're willing to serve up */ static struct { - char *ext; - char *mtype; + const char *ext; + const char *mtype; } mimetypes[] = { { "png", "image/png" }, { "jpg", "image/jpeg" }, @@ -120,6 +120,7 @@ static struct { { "wav", "audio/x-wav" }, { "mp3", "audio/mpeg" }, { "svg", "image/svg+xml" }, + { "svgz", "image/svg+xml" }, { "gif", "image/gif" }, }; @@ -131,7 +132,7 @@ struct http_uri_redirect { static AST_RWLIST_HEAD_STATIC(uri_redirects, http_uri_redirect); -static char *ftype2mtype(const char *ftype, char *wkspace, int wkspacelen) +static const char *ftype2mtype(const char *ftype, char *wkspace, int wkspacelen) { int x; if (ftype) { @@ -160,7 +161,8 @@ static struct ast_str *static_callback(struct sockaddr_in *req, const char *uri, { struct ast_str *result; char *path; - char *ftype, *mtype; + char *ftype; + const char *mtype; char wkspace[80]; struct stat st; int len; @@ -178,7 +180,7 @@ static struct ast_str *static_callback(struct sockaddr_in *req, const char *uri, if ((ftype = strrchr(uri, '.'))) ftype++; - mtype=ftype2mtype(ftype, wkspace, sizeof(wkspace)); + mtype = ftype2mtype(ftype, wkspace, sizeof(wkspace)); /* Cap maximum length */ len = strlen(uri) + strlen(ast_config_AST_DATA_DIR) + strlen("/static-http/") + 5; |