Skip to content

Weird problem with Apache-Coyote Last-modifed [rt.cpan.org #65125] #35

Description

@oalders

Migrated from rt.cpan.org#65125 (status was 'new')

Requestors:

From wjgeorge7@yahoo.com on 2011-01-25 21:27:41:

For some unknown reason I've spotted a non-conformat header from Apache. 

Last-Modified: Tue, 25 January 2011 21:18:00 GMT

It's a simple and logical patch to the current code to work around it.
Basically, since the @MoY field is all three letter combos, a
modification to the default match string seems to fix this issue

--- /var/www/cgi-bin/mte/extlib/HTTP/Date.pm	2011-01-25
16:25:21.000000000 -0500
+++ xxx	2011-01-25 16:24:57.000000000 -0500
@@ -37,7 +37,7 @@
     return undef unless defined $str;
 
     # fast exit for strictly conforming string
-    if ($str =~ /^[SMTWF][a-z][a-z], (\d\d) ([JFMAJSOND][a-z][a-z])
(\d\d\d\d) (\d\d):(\d\d):(\d\d) GMT$/) {
+    if ($str =~ /^[SMTWF][a-z][a-z], (\d\d)
([JFMAJSOND][a-z][a-z])[a-z]* (\d\d\d\d) (\d\d):(\d\d):(\d\d) GMT$/) {
 	return eval {
 	    my $t = Time::Local::timegm($6, $5, $4, $1, $MoY{$2}-1, $3-1900);
 	    $t < 0 ? undef : $t;


Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions