eprints/coversheets

Spurious filenames still return documents

Closed this issue · 0 comments

If you have coversheeted version of a document that should cause a URL rewrite to serve the coversheeted version when the original is requested this will return a PDF whatever the filename used in the URL. E.g.

This does not happen for documents that are not coversheeted. This is due to the EP_TRIGGER_DOC_URL_REWRITE trigger in z_coversheet_trigger.pl. Specifically:

$request->pnotes( filename => $coverdoc->get_main );

This should be modified to only allow the filename to be updated if the filename of the original document matches that used in the URL. This will save an infinite number of URLs being able to return the same document and give the same behaviour as non-coversheeted documents where a 404 error code will be returned because a document with the filename in the URL cannot be found.

Google looks to be having an issue with this at the moment on a particular EPrints repository, where it is trying to index loads of URLs that are basically the same except for the filename, like used in the examples above.