From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.bugs,gmane.lisp.guile.user Subject: bug#10147: HTTP "Expires" header should handle non-date values Date: Wed, 21 Dec 2011 21:51:04 -0500 Message-ID: <87ty4tqpyf.fsf@pobox.com> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1324522325 15241 80.91.229.12 (22 Dec 2011 02:52:05 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 22 Dec 2011 02:52:05 +0000 (UTC) Cc: "R. P. Dillon" , guile-user@gnu.org, 10147@debbugs.gnu.org To: Daniel Hartwig Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Thu Dec 22 03:52:01 2011 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RdYlE-0001hE-JY for guile-bugs@m.gmane.org; Thu, 22 Dec 2011 03:52:00 +0100 Original-Received: from localhost ([::1]:46806 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RdYlD-00012H-3l for guile-bugs@m.gmane.org; Wed, 21 Dec 2011 21:51:59 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:38683) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RdYlA-00011x-LS for bug-guile@gnu.org; Wed, 21 Dec 2011 21:51:57 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RdYl9-0005Ew-GN for bug-guile@gnu.org; Wed, 21 Dec 2011 21:51:56 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:47711) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RdYl9-0005Er-DU for bug-guile@gnu.org; Wed, 21 Dec 2011 21:51:55 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1RdYnB-0001Dl-U7 for bug-guile@gnu.org; Wed, 21 Dec 2011 21:54:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Andy Wingo Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-guile@gnu.org Resent-Date: Thu, 22 Dec 2011 02:54:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10147 X-GNU-PR-Package: guile X-GNU-PR-Keywords: patch Original-Received: via spool by 10147-submit@debbugs.gnu.org id=B10147.13245224004641 (code B ref 10147); Thu, 22 Dec 2011 02:54:01 +0000 Original-Received: (at 10147) by debbugs.gnu.org; 22 Dec 2011 02:53:20 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RdYmV-0001Co-Sy for submit@debbugs.gnu.org; Wed, 21 Dec 2011 21:53:20 -0500 Original-Received: from a-pb-sasl-sd.pobox.com ([74.115.168.62] helo=sasl.smtp.pobox.com) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RdYmS-0001Ce-DY for 10147@debbugs.gnu.org; Wed, 21 Dec 2011 21:53:18 -0500 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTP id 753D58F9A; Wed, 21 Dec 2011 21:51:08 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=w/nGN8Bv4OpOyF/0YGcDFRmlfzY=; b=Y4mYDQ ZLcJ0yU5bSpkpcRvX4R6ZxqGhdNiBgzK0tcN7/aym8G2L+PxCRNt0WhT7xLT4Pc5 8NFGiYx7aCD6u6XdJzeNUymbxSqwiPWJDoFC87Fw3Ra0KWnDUfYuYnqfnq18XQim VxcrZbjHqXEKAidDjM/h89Am9qsrZZTR+Ntrw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=sasl; b=imKpnEG3VI/6i+2q9OZxSWXRrVQ8OoNf McCdsKi009kh/fdTQvxWVslBL0yhb2mjZxbyI7yI+snbn3FrJDKz6C33kInb8B+/ JADUFPLLzuBlC7LgnlgNdRwf151kBIAgUfNP0ewTpVHofu+0ygCHRQwbWwtX5RpP sP1VyrgN2vU= Original-Received: from a-pb-sasl-sd.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTP id 456EE8F97; Wed, 21 Dec 2011 21:51:08 -0500 (EST) Original-Received: from badger (unknown [184.174.165.119]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTPSA id 4BB9E8F94; Wed, 21 Dec 2011 21:51:07 -0500 (EST) In-Reply-To: (Daniel Hartwig's message of "Sun, 27 Nov 2011 18:39:12 +0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) X-Pobox-Relay-ID: CBED2E4E-2C47-11E1-9A2B-65B1DE995924-02397024!a-pb-sasl-sd.pobox.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Wed, 21 Dec 2011 21:54:01 -0500 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Original-Sender: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.bugs:6003 gmane.lisp.guile.user:9067 Archived-At: Hi Daniel, So sorry for the delay. On Sun 27 Nov 2011 05:39, Daniel Hartwig writes: > This is definitely a bug on Guile's part, HTTP/1.1 permits such values > for "Expires" headers [1], treating them as though they were a date in > the past: > > HTTP/1.1 clients and caches MUST treat other invalid date formats, > especially including the value "0", as in the past (i.e., "already > expired"). > > [1] http://tools.ietf.org/html/rfc2616#section-14.21 But that's right after saying The format is an absolute date and time as defined by HTTP-date in section 3.3.1; it MUST be in RFC 1123 date format: Expires = "Expires" ":" HTTP-date But, pragmatism may rule, here... > Attached patch permits non-date values for "Expires", leaving them as > strings (preferable, as such responses can be transparently forwarded > to other clients). The staleness of a response could be determined > quite crudely, e.g. > > (define (response-stale? r) > (let ((expires (response-expires r))) > (and expires > (or (not (date? expires)) ;; Indicates already expired. > (time<=? (date->time-utc expires) > (current-time)))))) Let us assume that it is a good idea to include this hack. Wouldn't it be better to keep the expires header as a date? Would any date in the past work fine? Would it be best to allow some special cases like "0" or "-1" instead? I'm just trying to limit the damage here :) WDYT? Andy -- http://wingolog.org/