On Tuesday 29 July 2008 14:48, Florent Daigni?re wrote:
> * bo-le at web.de <bo-le at web.de> [2008-07-29 15:38:06]:
> 
> > Am Dienstag, 29. Juli 2008 14:34 schrieb Florent Daigni?re:
> > > * saces at freenetproject.org <saces at freenetproject.org> [2008-07-27 
11:02:41]:
> > > > Author: saces
> > > > Date: 2008-07-27 11:02:41 +0000 (Sun, 27 Jul 2008)
> > > > New Revision: 21435
> > > >
> > > > Modified:
> > > >    trunk/freenet/src/freenet/clients/http/FProxyToadlet.java
> > > >    trunk/freenet/src/freenet/clients/http/QueueToadlet.java
> > > >    trunk/freenet/src/freenet/l10n/freenet.l10n.en.properties
> > > >    trunk/freenet/src/freenet/pluginmanager/PluginManager.java
> > > > Log:
> > > > if the ThawIndexBrowser plugin is installed provide a "open with" link 
on
> > > > the warning page
> > > >
> > > > Modified: trunk/freenet/src/freenet/clients/http/FProxyToadlet.java
> > > > ===================================================================
> > > > --- trunk/freenet/src/freenet/clients/http/FProxyToadlet.java   
2008-07-27
> > > > 09:16:02 UTC (rev 21434) +++
> > > > trunk/freenet/src/freenet/clients/http/FProxyToadlet.java       
> > > > 2008-07-27
> > > > 11:02:41 UTC (rev 21435) @@ -109,7 +109,7 @@
> > > >
> > > >         }
> > > >
> > > > -       public static void handleDownload(ToadletContext context, 
> > > > Bucket 
data,
> > > > BucketFactory bucketFactory, String mimeType, String 
requestedMimeType,
> > > > String forceString, boolean forceDownload, String basePath, FreenetURI
> > > > key, String extras, String referrer, boolean downloadLink, 
ToadletContext
> > > > ctx) throws ToadletContextClosedException, IOException { +      public 
static
> > > > void handleDownload(ToadletContext context, Bucket data, BucketFactory
> > > > bucketFactory, String mimeType, String requestedMimeType, String
> > > > forceString, boolean forceDownload, String basePath, FreenetURI key,
> > > > String extras, String referrer, boolean downloadLink, ToadletContext 
ctx,
> > > > NodeClientCore core) throws ToadletContextClosedException, IOException 
{
> > > > if(Logger.shouldLog(Logger.MINOR, FProxyToadlet.class))
> > > >                         Logger.minor(FProxyToadlet.class,
> > > > "handleDownload(data.size="+data.size()+", mimeType="+mimeType+",
> > > > requestedMimeType="+requestedMimeType+", 
forceDownload="+forceDownload+",
> > > > basePath="+basePath+", key="+key); String extrasNoMime = extras; //
> > > > extras will not include MIME type to start with - REDFLAG maybe it 
should
> > > > be an array @@ -224,6 +224,11 @@
> > > >                         HTMLNode option = optionList.addChild("li");
> > > >                         L10n.addL10nSubstitution(option, 
> > > > "FProxyToadlet.openAsText", new
> > > > String[] { "link", "/link" }, new String[] { "<a
> > > > 
href=\""+basePath+key.toString()+"?type=text/plain"+extrasNoMime+"\">",
> > > > "</a>" }); // FIXME: is this safe? See bug #131
> > > > +
> > > > +                       
> > > > if((mimeType.equals("application/x-freenet-index")) &&
> > > > 
(core.node.pluginManager.isPluginLoaded("plugins.ThawIndexBrowser.ThawInd
> > > >exBrowser"))) { +                                option = 
> > > >optionList.addChild("li");
> > > > +                               L10n.addL10nSubstitution(option, 
> > > > "FProxyToadlet.openAsThawIndex",
> > > > new String[] { "link", "/link" }, new String[] { "<a href=\""+basePath 
+
> > > > "plugins/plugins.ThawIndexBrowser.ThawIndexBrowser/?key=" +
> > > > key.toString() + "\">", "</a>" }); +                    }
> > > >                         option = optionList.addChild("li");
> > > >                         L10n.addL10nSubstitution(option, 
> > > > "FProxyToadlet.openForceDisk", 
new
> > > > String[] { "link", "/link" }, new String[] { "<a
> > > > href=\""+basePath+key.toString()+"?forcedownload"+extras+"\">", "</a>"
> > > > }); if(!(mimeType.equals("application/octet-stream") ||
> > > > mimeType.equals("application/x-msdownload"))) { @@ -436,8 +441,9 @@
> > >
> > > Heh! you should have moved the comment here!
> > >
> > > On a side note: what about drilling a hole in the content filter too so
> > > that it works even when the request isn't made from the QueueToadlet?
> > you meant a callback for plugins to register content handlers/filters?
> 
> We probably don't want to allow such things at this stage... But you
> could whitelist ThawIndexBrowser and create a filter for
> application/x-freenet-index :)

We could indeed do that for Thaw. But yes we'd need to filter it, if we can't 
be sure it's Thaw receiving it.
> 
> Have a look to src/freenet/clients/http/filter/ContentFilter.java
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: 
<https://emu.freenetproject.org/pipermail/devl/attachments/20080729/3bb57153/attachment.pgp>

Reply via email to