urlmon: Added application/x-gzip-compression filter.
This commit is contained in:
parent
fd15939497
commit
3d767fcb55
|
@ -339,6 +339,8 @@ static const WCHAR mimeImageXPng[] = {'i','m','a','g','e','/','x','-','p','n','g
|
|||
static const WCHAR mimeImageTiff[] = {'i','m','a','g','e','/','t','i','f','f',0};
|
||||
static const WCHAR mimeVideoAvi[] = {'v','i','d','e','o','/','a','v','i',0};
|
||||
static const WCHAR mimeVideoMpeg[] = {'v','i','d','e','o','/','m','p','e','g',0};
|
||||
static const WCHAR mimeAppXGzip[] = {'a','p','p','l','i','c','a','t','i','o','n','/',
|
||||
'x','-','g','z','i','p','-','c','o','m','p','r','e','s','s','e','d',0};
|
||||
|
||||
static const struct {
|
||||
LPCWSTR url;
|
||||
|
@ -407,6 +409,10 @@ static BYTE data51[] = {0x00,0x00,0x01,0xba,0xff};
|
|||
static BYTE data52[] = {0x00,0x00,0x01,0xb8,0xff};
|
||||
static BYTE data53[] = {0x00,0x00,0x01,0xba};
|
||||
static BYTE data54[] = {0x00,0x00,0x01,0xba,'<','h','t','m','l','>'};
|
||||
static BYTE data55[] = {0x1f,0x8b,'x'};
|
||||
static BYTE data56[] = {0x1f};
|
||||
static BYTE data57[] = {0x1f,0x8b,'<','h','t','m','l','>','t','e','s','t',0};
|
||||
static BYTE data58[] = {0x1f,0x8b};
|
||||
|
||||
static const struct {
|
||||
BYTE *data;
|
||||
|
@ -466,7 +472,11 @@ static const struct {
|
|||
{data51, sizeof(data51), mimeVideoMpeg},
|
||||
{data52, sizeof(data52), mimeAppOctetStream},
|
||||
{data53, sizeof(data53), mimeAppOctetStream},
|
||||
{data54, sizeof(data54), mimeTextHtml}
|
||||
{data54, sizeof(data54), mimeTextHtml},
|
||||
{data55, sizeof(data55), mimeAppXGzip},
|
||||
{data56, sizeof(data56), mimeTextPlain},
|
||||
{data57, sizeof(data57), mimeTextHtml},
|
||||
{data58, sizeof(data58), mimeAppOctetStream}
|
||||
};
|
||||
|
||||
static void test_FindMimeFromData(void)
|
||||
|
|
|
@ -469,6 +469,11 @@ static BOOL video_mpeg_filter(const BYTE const *b, DWORD size)
|
|||
&& (b[3] == 0xb3 || b[3] == 0xba);
|
||||
}
|
||||
|
||||
static BOOL application_xgzip_filter(const BYTE const *b, DWORD size)
|
||||
{
|
||||
return size > 2 && b[0] == 0x1f && b[1] == 0x8b;
|
||||
}
|
||||
|
||||
static BOOL text_plain_filter(const BYTE const *b, DWORD size)
|
||||
{
|
||||
const BYTE *ptr;
|
||||
|
@ -529,6 +534,8 @@ HRESULT WINAPI FindMimeFromData(LPBC pBC, LPCWSTR pwzUrl, LPVOID pBuffer,
|
|||
static const WCHAR wszImageBmp[] = {'i','m','a','g','e','/','b','m','p',0};
|
||||
static const WCHAR wszVideoAvi[] = {'v','i','d','e','o','/','a','v','i',0};
|
||||
static const WCHAR wszVideoMpeg[] = {'v','i','d','e','o','/','m','p','e','g',0};
|
||||
static const WCHAR wszAppXGzip[] = {'a','p','p','l','i','c','a','t','i','o','n','/',
|
||||
'x','-','g','z','i','p','-','c','o','m','p','r','e','s','s','e','d',0};
|
||||
static const WCHAR wszTextPlain[] = {'t','e','x','t','/','p','l','a','i','n','\0'};
|
||||
static const WCHAR wszAppOctetStream[] = {'a','p','p','l','i','c','a','t','i','o','n','/',
|
||||
'o','c','t','e','t','-','s','t','r','e','a','m','\0'};
|
||||
|
@ -545,6 +552,7 @@ HRESULT WINAPI FindMimeFromData(LPBC pBC, LPCWSTR pwzUrl, LPVOID pBuffer,
|
|||
{wszImageBmp, image_bmp_filter},
|
||||
{wszVideoAvi, video_avi_filter},
|
||||
{wszVideoMpeg, video_mpeg_filter},
|
||||
{wszAppXGzip, application_xgzip_filter},
|
||||
{wszTextPlain, text_plain_filter},
|
||||
{wszAppOctetStream, application_octet_stream_filter}
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue