mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-16 22:43:12 +00:00
Fix bug introduced by DS-285 changes when accessing Bitstream without Item, i.e. /bitstream/id/NNN
git-svn-id: http://scm.dspace.org/svn/repo/dspace/trunk@4465 9c30dcfa-912a-0410-8fc2-9e0234be79fd
This commit is contained in:
@@ -516,7 +516,7 @@ public class BitstreamReader extends AbstractReader implements Recyclable
|
|||||||
{
|
{
|
||||||
// Check for if-modified-since header -- ONLY if not authenticated
|
// Check for if-modified-since header -- ONLY if not authenticated
|
||||||
long modSince = request.getDateHeader("If-Modified-Since");
|
long modSince = request.getDateHeader("If-Modified-Since");
|
||||||
if (modSince != -1 && item.getLastModified().getTime() < modSince)
|
if (modSince != -1 && item != null && item.getLastModified().getTime() < modSince)
|
||||||
{
|
{
|
||||||
// Item has not been modified since requested date,
|
// Item has not been modified since requested date,
|
||||||
// hence bitstream has not; return 304
|
// hence bitstream has not; return 304
|
||||||
@@ -531,7 +531,7 @@ public class BitstreamReader extends AbstractReader implements Recyclable
|
|||||||
// users in the cache for a response later to anonymous user.
|
// users in the cache for a response later to anonymous user.
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (isSpider || ContextUtil.obtainContext(request).getCurrentUser() == null)
|
if (item != null && (isSpider || ContextUtil.obtainContext(request).getCurrentUser() == null))
|
||||||
{
|
{
|
||||||
// TODO: Currently just borrow the date of the item, since
|
// TODO: Currently just borrow the date of the item, since
|
||||||
// we don't have last-mod dates for Bitstreams
|
// we don't have last-mod dates for Bitstreams
|
||||||
|
Reference in New Issue
Block a user