bugfix for sharing png/gif files in WWW/SHARE

http://www.yacy-forum.de/viewtopic.php?p=11565


git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@966 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
allo 19 years ago
parent af3060938b
commit 117a424d00

@ -425,6 +425,7 @@ public final class httpdFileHandler extends httpdAbstractHandler implements http
if (!(path.startsWith("/"))) path = "/" + path; // attach leading slash
File targetFile = getLocalizedFile(path);
String targetExt = conProp.getProperty("EXT","");
targetClass = rewriteClassFile(new File(htDefaultPath, path));
if (path.endsWith("/")) {
String testpath;
// attach default file name
@ -442,11 +443,10 @@ public final class httpdFileHandler extends httpdAbstractHandler implements http
}
}
}else{
if (!(targetFile.exists()) && (!(path.endsWith("png")||path.endsWith("gif")))){
//you cannot share a .png/.gif file with a name like a class in htroot.
if ( !(targetFile.exists()) && !((path.endsWith("png")||path.endsWith("gif"))&&targetClass!=null ) ){
targetFile = new File(htDocsPath, path);
targetClass = rewriteClassFile(new File(htDocsPath, path));
}else{
targetClass = rewriteClassFile(new File(htDefaultPath, path));
}
}

Loading…
Cancel
Save