]> git.kaiwu.me - nginx.git/commitdiff
test GIF87a
authorIgor Sysoev <igor@sysoev.ru>
Fri, 5 Jun 2009 07:29:47 +0000 (07:29 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Fri, 5 Jun 2009 07:29:47 +0000 (07:29 +0000)
src/http/modules/ngx_http_image_filter_module.c

index b0e5fed6b7280c32ff303e2af4e850c37375630e..469d703f6bc0c960b821a90366dc721571467194 100644 (file)
@@ -383,11 +383,12 @@ ngx_http_image_test(ngx_http_request_t *r, ngx_chain_t *in)
         return NGX_HTTP_IMAGE_JPEG;
 
     } else if (p[0] == 'G' && p[1] == 'I' && p[2] == 'F' && p[3] == '8'
-               && p[4] == '9' && p[5] == 'a')
+               && p[5] == 'a')
     {
-        /* GIF */
-
-        return NGX_HTTP_IMAGE_GIF;
+        if (p[4] == '9' || p[4] == '7') {
+            /* GIF */
+            return NGX_HTTP_IMAGE_GIF;
+        }
 
     } else if (p[0] == 0x89 && p[1] == 'P' && p[2] == 'N' && p[3] == 'G'
                && p[4] == 0x0d && p[5] == 0x0a && p[6] == 0x1a && p[7] == 0x0a)