From 117a424d0087be5dc239b3c26ba8f4892b4c9dc6 Mon Sep 17 00:00:00 2001 From: allo Date: Thu, 20 Oct 2005 14:58:15 +0000 Subject: [PATCH] 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 --- source/de/anomic/http/httpdFileHandler.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/de/anomic/http/httpdFileHandler.java b/source/de/anomic/http/httpdFileHandler.java index c57c40784..01b68630f 100644 --- a/source/de/anomic/http/httpdFileHandler.java +++ b/source/de/anomic/http/httpdFileHandler.java @@ -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)); } }