[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#798978: marked as done (Snapshot.debian.org not following HTTP standards reg. ETag)



Your message dated Mon, 14 Sep 2015 19:11:59 +0200
with message-id <20150914171159.GY9310@anguilla.noreply.org>
and subject line Re: Snapshot.debian.org not following HTTP standards reg. ETag
has caused the Debian Bug report #798978,
regarding Snapshot.debian.org not following HTTP standards reg. ETag
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
798978: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=798978
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: snapshot.debian.org

Michael Bisbjerg reports in
<CADhDKZsO6czbvDoKMiTqMs-x_ynA-x45ToKBu81nf6RNvyZf7A@mail.gmail.com>
that the snapshot web-app does not do etags correctly.

-- 
                            |  .''`.       ** Debian **
      Peter Palfrader       | : :' :      The  universal
 https://www.palfrader.org/ | `. `'      Operating System
                            |   `-    https://www.debian.org/

--- End Message ---
--- Begin Message ---
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 ---

Reply to: