CPAN-API/metacpan-web — Issue #405: 404 for Empty but existent files
Author: rwstauner
Created: 2011-12-05 04:12:34+00:00
State: open
Labels: Bug, Minor

https://metacpan.org/source/BRADH/HTML-JQuery-1.2.0/Changes

returns 404 and says "resource not found"

even though I followed the link for the file from the Browse page:

https://metacpan.org/source/BRADH/HTML-JQuery-1.2.0/

I can confirm the file's existence with `cpanm --look HTML::JQuery`... the file is there, but empty.

I'm guessing the site returns 404 because the `elsif ( $source->{raw} ) {` returns false for a zero-byte file
and the else branch is `detach`:
https://github.com/CPAN-API/metacpan-web/blob/master/lib/MetaCPAN/Web/Controller/Source.pm#L38

So I guess the question is what should we be doing, and what's the proper change?
`exists $source->{raw}` ?
`defined`?