--- Begin Message ---
- To: Michael Bisbjerg <michael@mbwarez.dk>
- Cc: 798978-done@bugs.debian.org
- Subject: Re: Snapshot.debian.org not following HTTP standards reg. ETag
- From: Peter Palfrader <weasel@debian.org>
- Date: Mon, 14 Sep 2015 19:11:59 +0200
- Message-id: <20150914171159.GY9310@anguilla.noreply.org>
- In-reply-to: <CADhDKZsO6czbvDoKMiTqMs-x_ynA-x45ToKBu81nf6RNvyZf7A@mail.gmail.com>
- References: <CADhDKZsO6czbvDoKMiTqMs-x_ynA-x45ToKBu81nf6RNvyZf7A@mail.gmail.com>
On Thu, 20 Aug 2015, Michael Bisbjerg wrote:
> While performing requests against http://snapshot.debian.org/, I came
> across the fact that I can't do cachine using ETag's with my current
> client. It turns out that the .NET HttpClient enforces the rules set forth
> by the HTTP spec, which dictates that entity-tag fields should be quoted,
> as seen in RFC7232 section 2.3.
>
> The snapshots service webserver does not provide quoted ETags. As an
> example, this URI:
> http://snapshot.debian.org/archive/debian-ports/20081002T000000Z/dists/experimental/Release
>
> Returns this header:
> ETag: 24357698cacd5843edee2e4777497f069285ad93
>
> Could this be fixed, so that it follows the standards?
How's it now?
} weasel@valiant:~$ HEAD http://snapshot.debian.org/archive/debian-ports/20081002T000000Z/dists/experimental/Release | grep -i etag
} ETag: "24357698cacd5843edee2e4777497f069285ad93"
Turns out, python-paste uses the return value of the calculate_etag() method
verbatim in the etag header. Any quoting needs to be done by the
calculate_etag() method itself.
--- a/web/app/snapshot/controllers/archive.py
+++ b/web/app/snapshot/controllers/archive.py
@@ -67,3 +67,3 @@ class SnapshotFileApp(FileApp):
def calculate_etag(self):
- return self.digest
+ return '"%s"' % (self.digest,)
Thanks for your report.
Cheers,
--
| .''`. ** Debian **
Peter Palfrader | : :' : The universal
https://www.palfrader.org/ | `. `' Operating System
| `- https://www.debian.org/
--- End Message ---