Re: [ietf-types] Registration of media typeimage/svg+xml

Chris Lilley <> Thu, 18 November 2010 20:01 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id CD4D43A68CF for <>; Thu, 18 Nov 2010 12:01:48 -0800 (PST)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -5.732
X-Spam-Status: No, score=-5.732 tagged_above=-999 required=5 tests=[AWL=-3.133, BAYES_00=-2.599]
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id hekhXt0cXV0A for <>; Thu, 18 Nov 2010 12:01:47 -0800 (PST)
Received: from ( []) by (Postfix) with ESMTP id A1D5D3A6834 for <>; Thu, 18 Nov 2010 12:01:46 -0800 (PST)
Received: from ( []) by (8.13.8/8.13.8) with ESMTP id oAIK1xF8002883 for <>; Thu, 18 Nov 2010 12:02:19 -0800
Received: from localhost ([]) by with esmtpa (Exim 4.69) (envelope-from <>) id 1PJAg8-000248-Ty; Thu, 18 Nov 2010 15:01:57 -0500
Date: Thu, 18 Nov 2010 21:01:21 +0100
From: Chris Lilley <>
X-Mailer: The Bat! (v3.95.6) Home
Organization: W3C
X-Priority: 3 (Normal)
Message-ID: <>
To: Julian Reschke <>
In-Reply-To: <>
References: <> <> <>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.0 ( []); Thu, 18 Nov 2010 12:02:19 -0800 (PST)
Cc: Alexey Melnikov <>,,
Subject: Re: [ietf-types] Registration of media typeimage/svg+xml
X-Mailman-Version: 2.1.9
Precedence: list
Reply-To: Chris Lilley <>
List-Id: "Media \(MIME\) type review" <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-Subscribe: <>, <>
X-List-Received-Date: Thu, 18 Nov 2010 20:01:48 -0000

On Thursday, November 18, 2010, 8:19:20 PM, Julian wrote:

JR> On 18.11.2010 19:02, Chris Lilley wrote:
>> ...
>> Security considerations:
>> ...
>>      SVG documents may be transmitted in compressed form using gzip
>>      compression. For systems which employ MIME-like mechanisms, such
>>      as HTTP, this is indicated by the Content-Encoding or
>>      Transfer-Encoding header, as appropriate; for systems which do
>>      not, such as direct filesystem access, this is indicated by the
>>      filename extension and by the Macintosh File Type Codes. In
>>      addition, gzip compressed content is readily recognised by the
>>      initial byte sequence as described in [RFC1952] section 2.3.1.
>> ...

JR> 1) What does this have to do with "Security Considerations"?

Please read BCP 13, RFC 4288 section 4.6 "Security requirements" where you will find

      A media type that employs compression may provide an opportunity
      for sending a small amount of data that, when received and
      evaluated, expands enormously to consume all of the recipient's
      resources.  All media types SHOULD state whether or not they
      employ compression, and if they do they should discuss 
      what  steps need to be taken to avoid such attacks.

JR> 2) I find the whole paragraph misleading; I'd like to see a clear 
JR> statement about whether the stream of octets resulting from gzipping SVG
JR> can be labeled as "image/svg+xml" or not 

Not by itself, no. In a MIME context, it must be labelled as Content-type: image/svg+xml **AND** Transfer-Encoding: gzip. Please note the AND.

This is not the same thing as Content-type: application/octet-stream and  Transfer-Encoding: gzip - because that conveys the encoding, but omits the content type.

In other words the encoding label ADDS TO the media type; it does not remove the type.

Indeed, this is why separate labelling of encoding was added. Back in the early days people would use gzipped VRML or gzipped PostScript, and attempted to register application/gzip; but since they were using the Media Type to hold the encoding information they had lost important information, so VRML viewers were sent PostScript and so on.  Some people said this was okay, unzip and then look at the filename extension. But a much better way was to add the encoding headers.

JR> (please consider transports 
JR> other than HTTP, such as a file system that actually supports typing by
JR> Internet media types).

Please feel free to file a bug report for the BeOS filesystem saying that it should support labelling of encodings in addition to media types. 

Speaking as a former BeOS user myself, I still consider modern SVG implementations (of which there are many) to be a rather more numerous and relevant consideration than a promising, but obsolete and abandoned, operating system from 15 years ago.

JR> If yes, that's a violation of "+xml" (and the last sentence points into
JR> this direction). If not, please remove the paragraph above.

JR> 3) If the intent is to say that "svgz" acts as file extension for 
JR> gzipped SVG, and *that* content can be served over HTTP as-is with

JR>         Content-Type: image/svg+xml
JR>         Content-Encoding: gzip

That is exactly what it says, yes

JR> than this is obviously ok 

I'm glad its obviously OK.

JR> because it follows from RFC 2616, and has 
JR> *nothing* to do with the media type (except for the extension 
JR> recommendation).

So you oppose reminding people how to detect such gzipped content?

Why would you want to do that?

 Chris Lilley   Technical Director, Interaction Domain                 
 W3C Graphics Activity Lead, Fonts Activity Lead
 Co-Chair, W3C Hypertext CG
 Member, CSS, WebFonts, SVG Working Groups