]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Add "svgz" to the mimetypes table. (issue #9510, bkruse)
authorRussell Bryant <russell@russellbryant.com>
Wed, 11 Apr 2007 14:48:01 +0000 (14:48 +0000)
committerRussell Bryant <russell@russellbryant.com>
Wed, 11 Apr 2007 14:48:01 +0000 (14:48 +0000)
In passing, constify the elements of the mimetypes table.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@61407 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/http.c

index 99aae15ed478543991c9bced5917e825470678e3..9c0919a78d1af00a6febde1e9ef48a9e68ea4891 100644 (file)
@@ -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;