Hello Maxim,<br><br>thanks for you explanation.<br>Only one doubt, the rfc2616 on the same paragraph says<br>"HTTP/1.1 clients and servers that parse the date value MUST accept
   all three formats (for compatibility with HTTP/1.0), though they MUST
   only generate the <a href="http://tools.ietf.org/html/rfc1123">RFC 1123</a> format for representing HTTP-date values
   in header fields. See <a href="http://tools.ietf.org/html/rfc2616#section-19.3">section 19.3</a> for further information."<br><br>This isn't the case for relax the parser? We are parsing dates.<br><br>Regards<br>
<div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Nov 9, 2012 at 1:53 PM, Maxim Dounin <span dir="ltr"><<a href="mailto:mdounin@mdounin.ru" target="_blank">mdounin@mdounin.ru</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hello!<br>
<div class="im"><br>
On Fri, Nov 09, 2012 at 12:37:50PM -0200, Wandenberg Peixoto wrote:<br>
<br>
> I was checking a strange behavior when parsing dates coming from different<br>
> browsers with this function and observed that it not supports dates with<br>
> only one digit, it expect that the date comes with 01, 02, 03 ...<br>
> But as rfc822 and rfc2822 says the day can be 1, 2 , 3, ... 10, 15, ...<br>
> So I am proposing this patch to be compliant with the rfc.<br>
<br>
</div>What nginx supports is specified here:<br>
<br>
<a href="http://tools.ietf.org/html/rfc2616#section-3.3.1" target="_blank">http://tools.ietf.org/html/rfc2616#section-3.3.1</a><br>
<br>
This includes support for 1-digit years as per asctime() format.<br>
Format which is subset of date format defined by RFC 1123 (RFC822)<br>
require two digits as per syntax.<br>
<br>
That is, nginx is perfectly RFC complaint - you just looking at<br>
wrong RFC.<br>
<br>
Just for reference, here are the syntax provided in RFC 2616:<br>
<br>
       HTTP-date    = rfc1123-date | rfc850-date | asctime-date<br>
       rfc1123-date = wkday "," SP date1 SP time SP "GMT"<br>
       rfc850-date  = weekday "," SP date2 SP time SP "GMT"<br>
       asctime-date = wkday SP date3 SP time SP 4DIGIT<br>
       date1        = 2DIGIT SP month SP 4DIGIT<br>
                      ; day month year (e.g., 02 Jun 1982)<br>
       date2        = 2DIGIT "-" month "-" 2DIGIT<br>
                      ; day-month-year (e.g., 02-Jun-82)<br>
       date3        = month SP ( 2DIGIT | ( SP 1DIGIT ))<br>
                      ; month day (e.g., Jun  2)<br>
<div class="im"><br>
> I expect that this patch could be applied to nginx code.<br>
<br>
</div>I don't think it's a good idea to relax parsing beyond what<br>
RFC 2616 requires unless there is really good reason to.<br>
<br>
[...]<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Maxim Dounin<br>
<a href="http://nginx.com/support.html" target="_blank">http://nginx.com/support.html</a><br>
<br>
_______________________________________________<br>
nginx-devel mailing list<br>
<a href="mailto:nginx-devel@nginx.org">nginx-devel@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx-devel" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx-devel</a><br>
</font></span></blockquote></div><br></div>