From: Bruce Lilly (blilly@erols.com)
Date: Tue Feb 03 2004 - 20:47:04 CST
Charles Lindsey wrote:
>In <87fzduy3wp.fsf@windlord.stanford.edu> Russ Allbery <rra@stanford.edu> writes:
>
>
>>Parsing Injector-Info in its current form in order to get that information
>>is, I believe, a non-starter. It's certainly code I have no interest in
>>writing.
>>
>>
>
>I don't think it would be that bad, but I hear preferences for a separate
>new header.
>
It's bad. There's a significant amount of work required to get from a
parameter to
the same textual date-time format as used in Date and Expires fields.
First one has
to parse the Injector-Info field to break it into base content and
parameters. Then
the parameters have to be examined to find the "posting-date" attribute
(possibly
with modifiers). Then any splitting, encoding, charset conversion, and
quoting
have to be undone. Consider the example:
Injector-Info: farkle.blurfl.edu ;
posting-host*2=.edu ;
posting-date*4*=N%F0%F0%F0%F0 ;
posting-host*1=.blurfl ;
posting-date*0*=EBCDIC-INT''%E3%A4%85k%40 ;
posting-host*0=luser ;
posting-date*1*=%F0%F4%40%C6%85%82%40 ;
posting-date*2*=%F2%F0%F0%F4%40 ;
posting-date*3*=%F2%F0%7A%F5%F7%7A%F5%F8%40
Getting a date-time from that is left as an exercise for the reader.
An injector probably wouldn't generate something quite like that, but it
is legal and valid, and a parser would need to be able to handle it
correctly.
Library code to do all of that exists, but it's non-trivial and is code
that is
simply not needed to parse a simple field such as Date or Expires. Please
remember this example when you're tempted to put parameters everywhere.