unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: Andy Wingo <wingo@pobox.com>
To: Daniel Hartwig <mandyke@gmail.com>
Cc: "R. P. Dillon" <rpdillon@gmail.com>,
	guile-user@gnu.org, 10147@debbugs.gnu.org
Subject: bug#10147: HTTP "Expires" header should handle non-date values
Date: Thu, 22 Dec 2011 07:35:24 -0500	[thread overview]
Message-ID: <87hb0srdgz.fsf@pobox.com> (raw)
In-Reply-To: <CAN3veRcbLH8FRK1zPwMDSN1OOBLWXuk-NaDVc2mkTyTpCiapWQ@mail.gmail.com> (Daniel Hartwig's message of "Thu, 22 Dec 2011 12:28:01 +0800")

On Wed 21 Dec 2011 23:28, Daniel Hartwig <mandyke@gmail.com> writes:

> On 22 December 2011 10:51, Andy Wingo <wingo@pobox.com> wrote:
>>
>> On Sun 27 Nov 2011 05:39, Daniel Hartwig <mandyke@gmail.com> writes:
>>
>>>    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").
>>
>> But, pragmatism may rule, here...
>
> ... especially given that players like Google are using "-1" ;-)

Yes, indeed.

>> ... Wouldn't it
>> be better to keep the expires header as a date?  Would any date in the
>> past work fine?
>
> That is what I initially considered.  I considered using a single,
> well defined value for date-in-the-past (Unix epoch).

I think I would prefer this.  It makes user code easier, and with more
of a chance of being correct.  I think that Mozilla at least used to use
the beginnning of the epoch as this date.

>> Would it be best to allow some special cases like "0" or "-1" instead?
>>
>
> Not sure precisely what you mean here.  Is it something like:
>
> (or (false-if-exception (parse-date str))
>     (and (memq str '("0" "-1")) str)
>     date-in-the-past)

More like:

  (if (member str '("0" "-1"))
      date-in-the-past
      (parse-date str))

Then we can wait and see -- if only these two values are out there, then
we are good, and we keep the "validating" characteristic of our date
parser.  Otherwise we can fall back to the false-if-exception dance if
someone submits a bug report.

WDYT?  Want to send another patch? :-)

Andy
-- 
http://wingolog.org/





  reply	other threads:[~2011-12-22 12:35 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-27 10:39 HTTP "Expires" header should handle non-date values Daniel Hartwig
2011-12-22  2:51 ` bug#10147: " Andy Wingo
2011-12-22  4:28   ` Daniel Hartwig
2011-12-22 12:35     ` Andy Wingo [this message]
2011-12-27 15:49       ` Daniel Hartwig
     [not found]       ` <CAN3veRfgg+dDzjMy1L8xaAcaZ82dAuFM1dnNpGbzq-5ckoVsAA@mail.gmail.com>
2012-01-09 22:36         ` Andy Wingo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87hb0srdgz.fsf@pobox.com \
    --to=wingo@pobox.com \
    --cc=10147@debbugs.gnu.org \
    --cc=guile-user@gnu.org \
    --cc=mandyke@gmail.com \
    --cc=rpdillon@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).