6713
INFORMATIONAL
The 'application/zlib' and 'application/gzip' Media Types
Authors: J. Levine
Date: August 2012
Working Group: NON WORKING GROUP
Stream: IETF
Abstract
This document defines the 'application/gzip' and 'application/zlib' media types for compressed data using the gzip and zlib compression formats. This document is not an Internet Standards Track specification; it is published for informational purposes.
RFC 6713
INFORMATIONAL
Internet Engineering Task Force (IETF) J. Levine
Request for Comments: 6713 Taughannock Networks
Category: Informational August 2012
ISSN: 2070-1721
<span class="h1">The 'application/zlib' and 'application/gzip' Media Types</span>
Abstract
This document defines the 'application/gzip' and 'application/zlib'
media types for compressed data using the gzip and zlib compression
formats.
Status of This Memo
This document is not an Internet Standards Track specification; it is
published for informational purposes.
This document is a product of the Internet Engineering Task Force
(IETF). It represents the consensus of the IETF community. It has
received public review and has been approved for publication by the
Internet Engineering Steering Group (IESG). Not all documents
approved by the IESG are a candidate for any level of Internet
Standard; see <a href="./rfc5741#section-2">Section 2 of RFC 5741</a>.
Information about the current status of this document, any errata,
and how to provide feedback on it may be obtained at
<a href="https://www.rfc-editor.org/info/rfc6713">http://www.rfc-editor.org/info/rfc6713</a>.
Copyright Notice
Copyright (c) 2012 IETF Trust and the persons identified as the
document authors. All rights reserved.
This document is subject to <a href="https://www.rfc-editor.org/bcp/bcp78">BCP 78</a> and the IETF Trust's Legal
Provisions Relating to IETF Documents
(<a href="http://trustee.ietf.org/license-info">http://trustee.ietf.org/license-info</a>) in effect on the date of
publication of this document. Please review these documents
carefully, as they describe your rights and restrictions with respect
to this document. Code Components extracted from this document must
include Simplified BSD License text as described in Section 4.e of
the Trust Legal Provisions and are provided without warranty as
described in the Simplified BSD License.
<span class="grey">Levine Informational [Page 1]</span>
<span id="page-2" ></span>
<span class="grey"><a href="./rfc6713">RFC 6713</a> Media Types 'zlib' and 'gzip' August 2012</span>
<span class="h2"><a class="selflink" id="section-1" href="#section-1">1</a>. Introduction</span>
zlib [<a href="./rfc1950" title=""ZLIB Compressed Data Format Specification version 3.3"">RFC1950</a>] and gzip [<a href="./rfc1952" title=""GZIP file format specification version 4.3"">RFC1952</a>] 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 [<a href="./rfc1951" title=""DEFLATE Compressed Data Format Specification version 1.3"">RFC1951</a>].
They are used to compress a wide variety of material, from
unstructured text to structured data to executable code.
Some applications have informally used media types such as
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.
<span class="h2"><a class="selflink" id="section-2" href="#section-2">2</a>. The 'application/zlib' Media Type</span>
The 'application/zlib' media type describes a block of data that is
compressed using zlib [<a href="./rfc1950" title=""ZLIB Compressed Data Format Specification version 3.3"">RFC1950</a>] compression. The data is a stream of
bytes as described in <a href="./rfc1950">RFC 1950</a>.
<span class="h3"><a class="selflink" id="section-2.1" href="#section-2.1">2.1</a>. Registration Details</span>
Type name: application
Subtype name: zlib
Required parameters: N/A
Optional parameters: N/A
Encoding considerations: Binary
Security considerations: See <a href="#section-4">Section 4</a> below.
Interoperability considerations: N/A
Published specification: [<a href="./rfc1950" title=""ZLIB Compressed Data Format Specification version 3.3"">RFC1950</a>]
Applications that use this media type: anywhere data size is an issue
Additional information:
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.
<span class="grey">Levine Informational [Page 2]</span>
<span id="page-3" ></span>
<span class="grey"><a href="./rfc6713">RFC 6713</a> Media Types 'zlib' and 'gzip' August 2012</span>
File extension(s): N/A
Macintosh file type code(s): N/A
Person and email address to contact for further information: see
<a href="http://www.zlib.net/">http://www.zlib.net/</a>
Intended usage: COMMON
Restrictions on usage: N/A
Author: John Levine
Change controller: IETF
<span class="h2"><a class="selflink" id="section-3" href="#section-3">3</a>. The 'application/gzip' Media Type</span>
The 'application/gzip' media type describes a block of data that is
compressed using gzip [<a href="./rfc1952" title=""GZIP file format specification version 4.3"">RFC1952</a>] compression. The data is a stream of
bytes as described in <a href="./rfc1952">RFC 1952</a>.
<span class="h3"><a class="selflink" id="section-3.1" href="#section-3.1">3.1</a>. Registration Details</span>
Type name: application
Subtype name: gzip
Required parameters: N/A
Optional parameters: N/A
Encoding considerations: Binary
Security considerations: See <a href="#section-4">Section 4</a> below.
Interoperability considerations: N/A
Published specification: [<a href="./rfc1952" title=""GZIP file format specification version 4.3"">RFC1952</a>]
Applications that use this media type: anywhere data size is an issue
Additional information:
Magic number(s): first two bytes are 0x1f, 0x8b.
File extension(s): gz
Macintosh file type code(s): N/A
Person and email address to contact for further information: see
<a href="http://www.gzip.org/">http://www.gzip.org/</a>
<span class="grey">Levine Informational [Page 3]</span>
<span id="page-4" ></span>
<span class="grey"><a href="./rfc6713">RFC 6713</a> Media Types 'zlib' and 'gzip' August 2012</span>
Intended usage: COMMON
Restrictions on usage: N/A
Author: John Levine
Change controller: IETF
<span class="h2"><a class="selflink" id="section-4" href="#section-4">4</a>. Security Considerations</span>
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.
Also see the security considerations in the underlying format
documents: <a href="./rfc1950#section-5">Section 5 of [RFC1950]</a>, <a href="./rfc1951#section-6">Section 6 of [RFC1951]</a>, and
<a href="./rfc1952#section-4">Section 4 of [RFC1952]</a>.
<span class="h2"><a class="selflink" id="section-5" href="#section-5">5</a>. IANA Considerations</span>
IANA has updated the "Application Media Types" registry to include
'application/zlib' as described in <a href="#section-2">Section 2</a> and 'application/gzip'
as described in <a href="#section-3">Section 3</a>.
<span class="h2"><a class="selflink" id="section-6" href="#section-6">6</a>. Normative References</span>
[<a id="ref-RFC1950">RFC1950</a>] Deutsch, P. and J-L. Gailly, "ZLIB Compressed Data Format
Specification version 3.3", <a href="./rfc1950">RFC 1950</a>, May 1996.
[<a id="ref-RFC1951">RFC1951</a>] Deutsch, P., "DEFLATE Compressed Data Format Specification
version 1.3", <a href="./rfc1951">RFC 1951</a>, May 1996.
[<a id="ref-RFC1952">RFC1952</a>] Deutsch, P., "GZIP file format specification version 4.3",
<a href="./rfc1952">RFC 1952</a>, May 1996.
Author's Address
John Levine
Taughannock Networks
PO Box 727
Trumansburg, NY 14886
Phone: +1 831 480 2300
EMail: [email protected]
Levine Informational [Page 4]
Annotations
Select text to annotate