HTTP Content-Location header usage

Никита Пискунов <> Sat, 24 September 2016 21:06 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id E04FD12B046 for <>; Sat, 24 Sep 2016 14:06:51 -0700 (PDT)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -9.235
X-Spam-Status: No, score=-9.235 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_ADSP_CUSTOM_MED=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-2.316, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id niZGRvarYhHV for <>; Sat, 24 Sep 2016 14:06:50 -0700 (PDT)
Received: from ( []) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by (Postfix) with ESMTPS id 7E9B212B049 for <>; Sat, 24 Sep 2016 14:06:49 -0700 (PDT)
Received: from lists by with local (Exim 4.80) (envelope-from <>) id 1bnu5x-0004rA-RW for; Sat, 24 Sep 2016 21:02:49 +0000
Resent-Message-Id: <>
Received: from ([]) by with esmtps (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from <>) id 1bnu5n-0004ob-Cu for; Sat, 24 Sep 2016 21:02:39 +0000
Received: from ([]) by with esmtps (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from <>) id 1bnu5l-0001aG-LQ for; Sat, 24 Sep 2016 21:02:38 +0000
Received: from [] (helo=[]) by with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from <>) id 1bnu5k-000AGn-UA for; Sat, 24 Sep 2016 21:02:37 +0000
Content-Type: multipart/alternative; boundary="Apple-Mail=_548E7D3F-641C-4A3F-970E-4FF35D2F9786"
Mime-Version: 1.0 (Mac OS X Mail 10.0 \(3226\))
From: Никита Пискунов <>
Resent-From: Yves Lafon <>
Date: Wed, 21 Sep 2016 12:35:04 +0000
Resent-Date: Sat, 24 Sep 2016 23:02:34 +0200
Message-Id: <>
X-Name-Md5: efe3dad792d606410c9cc49cedaffc94
X-Mailer: Apple Mail (2.3226)
X-W3C-Hub-Spam-Status: No, score=-4.6
X-W3C-Scan-Sig: 1bnu5l-0001aG-LQ 2d1512918919e4aea92974574ea8eeab
Subject: HTTP Content-Location header usage
Archived-At: <>
X-Mailing-List: <> archive/latest/32417
Precedence: list
List-Id: <>
List-Help: <>
List-Post: <>
List-Unsubscribe: <>

i've already posted my comment about ambiguous Content-Location header usage description here as a GitHub Issue. And I've also decided to raise the discussion via email.

So, my question is:

The RFC 5789 discribes the apropriate usage of Content-Location header in PATCH:

A response to this method is only cacheable if it contains explicit freshness information (such as an Expires header or "Cache-Control: max-age" directive) as well as the Content-Location header matching the Request-URI, indicating that the PATCH response body is a resource representation.
So, it means, that Content-Location header must appear only if the actual represantation is the part of response body for PATCH.

Also the usage of Content-Location is mentioned in another RFC 7231:

For a state-changing request like PUT (Section 4.3.4) or POST (Section 4.3.3), it implies that the server's response contains the new representation of that resource, thereby distinguishing it from representations that might only report about the action (e.g., "It worked!"). This allows authoring applications to update their local copies without the need for a subsequent GET request.
So, accordingly to this information in both RFCs, the apropriate usage of Content-Location with state-changing requests are following:
Content-Location must appear in response only if response-body contains the new resourse representation.

But, there is also an example in RFC 5789:

Successful PATCH response to existing text file:

HTTP/1.1 204 No Content
Content-Location: /file.txt
ETag: "e0023aa4f"

The 204 response code is used because the response does not carry a message body (which a response with the 200 code would have). Note that other success codes could be used as well.

Furthermore, the ETag response header field contains the ETag for the entity created by applying the PATCH, available at <>, as indicated by the Content-Location response header field.
How you can see, there is a Content-Location presented in response with 204 status code (No content). Ofcourse, this response doesn't contain any body as well as new resourse representation. This fact adds some ambiguity in Content-Location header description. What is the correct usage of this header?