Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Plack-Middleware-ETag CPAN distribution.

Report information
The Basics
Id: 105035
Status: resolved
Priority: 0/
Queue: Plack-Middleware-ETag

People
Owner: Nobody in particular
Requestors: skaji [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: inode number is not be used for creating Etag.
Hi, According to perldoc, stat() function returns a list: 0 dev device number of filesystem 1 ino inode number 2 mode file mode (type and permissions) 3 nlink number of (hard) links to the file ... Please note that inode number is the 1-th item, NOT 2-th! In Plack/Middleware/ETag.pm, the 2-th item is used for inode number. https://metacpan.org/source/FRANCKC/Plack-Middleware-ETag-0.03/lib/Plack/Middleware/ETag.pm#L44 The following patch fixes this. --- ETag.pm +++ ETag.pm @@ -41,7 +41,7 @@ sub call { $etag = "W/"; } if ( grep {/inode/} @$file_attr ) { - $etag .= ( sprintf "%x", $stats[2] ); + $etag .= ( sprintf "%x", $stats[1] ); } if ( grep {/mtime/} @$file_attr ) { $etag .= "-" if ( $etag && $etag !~ /-$/ );
Hello, Thanks for reporting the bug. This has been fixed with https://github.com/franckcuny/plack-middleware-etag/commit/212e42649303b51f1697c6b9e5897f03d70ef14c and a new version is being uploaded to CPAN (0.05).