Author: toad
Date: 2007-06-21 12:29:25 +0000 (Thu, 21 Jun 2007)
New Revision: 13680
Modified:
trunk/freenet/src/freenet/client/async/SingleFileFetcher.java
Log:
Fix problem with allow-mime-types on containers
Modified: trunk/freenet/src/freenet/client/async/SingleFileFetcher.java
===================================================================
--- trunk/freenet/src/freenet/client/async/SingleFileFetcher.java
2007-06-21 12:14:40 UTC (rev 13679)
+++ trunk/freenet/src/freenet/client/async/SingleFileFetcher.java
2007-06-21 12:29:25 UTC (rev 13680)
@@ -308,7 +308,7 @@
} else if(metadata.isArchiveInternalRedirect()) {
if(logMINOR) Logger.minor(this, "Is
archive-internal redirect");
clientMetadata.mergeNoOverwrite(metadata.getClientMetadata());
- if(clientMetadata.getMIMETypeNoParams() != null
&& ctx.allowedMIMETypes != null &&
+ if(metaStrings.isEmpty() && isFinal &&
clientMetadata.getMIMETypeNoParams() != null && ctx.allowedMIMETypes != null &&
!ctx.allowedMIMETypes.contains(clientMetadata.getMIMETypeNoParams())) {
onFailure(new
FetchException(FetchException.WRONG_MIME_TYPE, -1, false,
clientMetadata.getMIMEType()));
return;
@@ -389,7 +389,7 @@
continue;
}
- if(mimeType != null && ctx.allowedMIMETypes !=
null &&
+ if(metaStrings.isEmpty() && isFinal && mimeType
!= null && ctx.allowedMIMETypes != null &&
!ctx.allowedMIMETypes.contains(mimeType)) {
onFailure(new
FetchException(FetchException.WRONG_MIME_TYPE, -1, false,
clientMetadata.getMIMEType()));
return;
@@ -447,7 +447,7 @@
continue;
}
- if(mimeType != null && ctx.allowedMIMETypes !=
null &&
+ if(metaStrings.isEmpty() && isFinal && mimeType
!= null && ctx.allowedMIMETypes != null &&
!ctx.allowedMIMETypes.contains(mimeType)) {
onFailure(new
FetchException(FetchException.WRONG_MIME_TYPE,
metadata.uncompressedDataLength(), false, clientMetadata.getMIMEType()));
return;