<?xml version="1.0" encoding="US-ASCII"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
<!ENTITY RFC1950 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.1950.xml">
<!ENTITY RFC1951 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.1951.xml">
<!ENTITY RFC1952 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.1952.xml">
<!ENTITY RFC4288 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.4288.xml">
]>
<?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?>
<?rfc strict="no" ?>
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes" ?>
<?rfc compact="yes" ?>
<?rfc subcompact="yes" ?>
<?rfc comments="yes" ?>
<rfc category="info" docName="draft-levine-application-gzip-03"
     ipr="trust200902">
  <front>
    <title abbrev="Media types zlib and gzip">The application/zlib and
    application/gzip media types</title>

    <author fullname="John Levine" initials="J.R." surname="Levine">
      <organization>Taughannock Networks</organization>

      <address>
        <postal>
          <street>PO Box 727</street>
          <city>Trumansburg</city>
          <region>NY</region>
          <code>14886</code>
        </postal>
        <phone>+1 831 480 2300</phone>
        <email>standards@taugh.com</email>
      </address>
    </author>

    <date month="June" year="2012"/>

    <area>Applications</area>

    <abstract>
      <t>This document defines the 'application/gzip' and 'application/zlib'
      media types for compressed data using the gzip and zlib compression
      formats.</t>
    </abstract>
  </front>

  <middle>
    <section anchor="intro" title="Introduction">
      <t>The <xref target="RFC1950">Zlib</xref> and <xref
      target="RFC1952">gzip</xref> formats are widely used compression
      formats. Zlib is a stream format, while gzip adds header and trailer
      fields more appropriate for a file format. Both implement the DEFLATE
      compression scheme described in <xref target="RFC1951"/>.</t>

      <t>They are used to compress a wide variety of material, from
      unstructured text to structured data to executable code.</t>

      <t>Some applications have informally used media types
	 including application/gzip-compressed, application/gzipped,
	 application/x-gunzip, application/x-gzip, application/x-gzip-compressed,
	 and gzip/document to describe data compressed with gzip.
	 The media types defined in this document should
	 replace those media types in future applications.</t>
    </section>

    <section anchor="zlib" title="The Application/Zlib Media Type">
      <t>The application/zlib media type describes a block of data that is
      compressed using <xref target="RFC1950">Zlib</xref> compression. The
      data is a stream of bytes as described in RFC 1950.</t>

      <section title="Registration Details">
        <t>Type name: application</t>

        <t>Subtype name: zlib</t>

        <t>Required parameters: N/A</t>

        <t>Optional parameters: N/A</t>

        <t>Encoding considerations: Binary.</t>

        <t>Security considerations: See section <xref target="security"/>
        below</t>

        <t>Interoperability considerations: N/A</t>

        <t>Published specification: <xref target="RFC1950"/></t>

        <t>Applications that use this media type: anywhere data size is an
        issue</t>

        <t>Additional information: <list style="empty">
            <t>Magic number(s): first byte is usually 0x78 but can also be
            0x08, 0x18, 0x28, 0x38, 0x48, 0x58, or 0x68. The first two
	    bytes when interpreted as an unsigned 16-bit number in
	    big-endian byte order contain a value that is a multiple of 31.</t>

            <t>File extension(s): N/A</t>

            <t>Macintosh file type code(s): N/A</t>
          </list></t>

        <t>Person and email address to contact for further information: see
        http://www.zlib.net/</t>

        <t>Intended usage: COMMON</t>

        <t>Restrictions on usage: N/A</t>

        <t>Author: John Levine</t>

        <t>Change controller: IETF</t>
      </section>
    </section>

    <section anchor="gzip" title="The Application/Gzip Media Type">
      <t>The application/gzip media type describes a block of data that is
      compressed using <xref target="RFC1952">gzip</xref> compression. The
      data is a stream of bytes as described in RFC 1952.</t>

      <section title="Registration Details">
        <t>Type name: application</t>

        <t>Subtype name: gzip</t>

        <t>Required parameters: N/A</t>

        <t>Optional parameters: N/A</t>

        <t>Encoding considerations: Binary.</t>

        <t>Security considerations: See section <xref target="security"/>
        below</t>

        <t>Interoperability considerations: N/A</t>

        <t>Published specification: <xref target="RFC1952"/></t>

        <t>Applications that use this media type: anywhere data size is an
        issue</t>

        <t>Additional information: <list style="empty">
            <t>Magic number(s): first two bytes are 0x1f, 0x8b.</t>

            <t>File extension(s): gz</t>

            <t>Macintosh file type code(s): N/A</t>
          </list></t>

        <t>Person and email address to contact for further information: see
        http://www.gzip.org/</t>

        <t>Intended usage: COMMON</t>

        <t>Restrictions on usage: N/A</t>

        <t>Author: John Levine</t>

        <t>Change controller: IETF</t>
      </section>
    </section>

    <section anchor="security" title="Security Considerations">
      <t>Zlib and gzip compression can be used to compress arbitrary binary
      data such as hostile executable code. Also, data that purports to be in
      zlib or gzip format may not be, and fields that are supposed to be
      flags, lengths, or pointers could contain anything. Applications should
      treat any data with due skepticism.</t>

      <t>Also see the security considerations in the underlying format
      documents, Section 5 of <xref target="RFC1950"/>, Section 6 of <xref
      target="RFC1951"/>, and Section 4 of <xref target="RFC1952"/>.</t>
    </section>
    <section anchor="iana" title="IANA Considerations">
       <t>IANA is requested to update the MIME Media Types registry to include
	  application/zlib as described in Section <xref target='zlib'/> and
	  application/gzip as described in Section <xref target='gzip'/>.
       </t>
    </section>
  </middle>

  <back>
    <references title="Normative References">
      &RFC1950;

      &RFC1951;

      &RFC1952;
    </references>
    <section title="Change log">
       <t>Note to editor: Please remove this section before publication.</t>
       <section title="Changes from -02 to -03">
	  <t>Add IANA considerations</t>
	  <t>Simplify encoding: binary and fix typos</t>
       </section>
       <section title="Changes from -01 to -02">
	  <t>Fix gzip.org </t>
	  <t>Note other former names</t>
       </section>
       <section title="Changes from -00 to -01">
	  <t>Note former x-gzip</t>
	  <t>Refer to security sections in underlying format docs</t>
       </section>
    </section>
  </back>
</rfc>
