--- HTTP.pm 2008/06/22 14:06:24 1.3 +++ HTTP.pm 2008/06/22 16:06:48 @@ -1,6 +1,6 @@ package Slim::Web::HTTP; -# $Id: HTTP.pm,v 1.3 2008/06/22 14:06:24 root Exp $ +# $Id: HTTP.pm,v 1.4 2008/06/22 14:06:45 root Exp root $ # SqueezeCenter Copyright 2001-2007 Logitech. # This program is free software; you can redistribute it and/or @@ -1237,6 +1237,18 @@ } else { ($mtime, $inode, $size) = getFileInfoForStaticContent($path, $params); + if (!defined($mtime)) { + # some error reading the file, just throw a 404 + # (should probably have a 500 error for this) + $log->warn("Couldn't open file for path $path -- check file and directory permissions"); + $response->code(RC_NOT_FOUND); + $response->content_type('text/html'); + $response->header('Connection' => 'close'); + $response->content_ref(filltemplatefile('html/errors/404.html', $params)); + $httpClient->send_response($response); + closeHTTPSocket($httpClient); + return; + } if (contentHasBeenModified($response, $mtime, $inode, $size)) {