views:

1095

answers:

1

I have an IIS6 web server (on Win2003) is having a strange behavior which I guess is some undocumented "feature" ...

It serves SVG files (extension .svg) without having it registered on the IIS metabase. It does not have the * mime type either.

For this request:

GET /basic/file1.svg HTTP/1.1

the response contains

HTTP/1.1 200 OK
Content-Length: 32817
Content-Type: image/svg+xml

So ... where does IIS got this image/svg+xml mime type?

The only place I found it is in Registry, at HKEY_CLASSES_ROOT\MIME\Database. But according to all the MS information I found, the source for IIS allowed mime types is it's own metabase.

Does anyone know this behavior? This could lead a IIS admin to a false sense of security...

Best regards everyone!!

+1  A: 

IIS merges MIME maps from the Metabase and the registry (HKCR\<extension>) to get the list of allowable Mime Types.

To list the metabase mime times, you can use:

adsutil.vbs get /MimeMap/mimemap

Which, unfortunately, prints out the mime map poorly:

D:\Apps\Scripts>adsutil.vbs get /MimeMap/mimemap
Microsoft (R) Windows Script Host Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.

MimeMap                         : (MimeMapList) ".asx,video/x-ms-asf" ".xml,text/xml" ".tsv,text/tab
-separated-values" ".ra,audio/x-pn-realaudio" ".sv4crc,application/x-sv4crc" ".spc,application/x-pkc
s7-certificates" ".pmc,application/x-perfmon" ".lit,application/x-ms-reader" ".crd,application/x-msc

Changing one line in ADSUtil.VBS fixes this (note the " vbCRLF & ") :

Line 1655:

        MimeOutPutStr = MimeOutPutStr & """" & MimeEntry.Extension & "," & MimeEntry.MimeType & """ "

to

        MimeOutPutStr = MimeOutPutStr & vbCRLF & """" & MimeEntry.Extension & "," & MimeEntry.MimeType & """ "

Produces output like this:

D:\Apps\Scripts>adsutil.vbs enum  /MimeMap
Microsoft (R) Windows Script Host Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.

KeyType                         : (STRING) "IIsMimeMap"
MimeMap                         : (MimeMapList)
".asx,video/x-ms-asf"
".xml,text/xml"
".tsv,text/tab-separated-values"
".ra,audio/x-pn-realaudio"
".sv4crc,application/x-sv4crc"
".spc,application/x-pkcs7-certificates"
".pmc,application/x-perfmon"
".lit,application/x-ms-reader"
".crd,application/x-mscardfile"
Christopher_G_Lewis