aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2007-04-11 14:48:01 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2007-04-11 14:48:01 +0000
commit67558d404735feab28e7b368483a4563f9442baa (patch)
treec9bbc38339391b400e5c2a1f3cc8f8b0e653156c /main
parent6df2abd79e37d2b00058d3e792e599fb97ffef54 (diff)
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/branches/1.4@61407 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main')
-rw-r--r--main/http.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/main/http.c b/main/http.c
index 99aae15ed..9c0919a78 100644
--- a/main/http.c
+++ b/main/http.c
@@ -79,8 +79,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" },
@@ -88,10 +88,11 @@ static struct {
{ "wav", "audio/x-wav" },
{ "mp3", "audio/mpeg" },
{ "svg", "image/svg+xml" },
+ { "svgz", "image/svg+xml" },
{ "gif", "image/gif" },
};
-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) {
@@ -109,7 +110,8 @@ static char *static_callback(struct sockaddr_in *req, const char *uri, struct as
char result[4096];
char *c=result;
char *path;
- char *ftype, *mtype;
+ char *ftype;
+ const char *mtype;
char wkspace[80];
struct stat st;
int len;
@@ -128,7 +130,7 @@ static char *static_callback(struct sockaddr_in *req, const char *uri, struct as
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;