On Thursday 05 June 2008 10:49:57 David ?Bombe? Roden wrote:

> So I need a way to retrieve a file from freenet _without_ the warning page
> and _without_ adding a query string to the URL. Can we introduce something
> like http://localhost:8888/unchecked/<key> to retrieve the file, no matter
> what?

Turns out it?s already almost in fproxy. By 
using "http://node:8888/?key=<key>" a redirect to "http://node:8888/<key>" is 
issued, and as curl follows redirects transparently this would work, if a 
given content type would also be used in the redirect target URL.

Index: src/freenet/clients/http/FProxyToadlet.java
===================================================================
--- src/freenet/clients/http/FProxyToadlet.java (revision 20211)
+++ src/freenet/clients/http/FProxyToadlet.java (working copy)
@@ -336,7 +336,12 @@
                                }

                                if(logMINOR) Logger.minor(this, "Redirecting to 
FreenetURI: "+newURI);
-                               headers.put("Location", "/"+newURI);
+                               String type = httprequest.getParam("type");
+                               if (type != null) {
+                                       headers.put("Location", "/" + newURI + 
"?type=" + type);
+                               } else {
+                                       headers.put("Location", "/" + newURI);
+                               }
                                ctx.sendReplyHeaders(302, "Found", headers, 
null, 0);
                                return;
                        }

Guess what this does. :) 

IMHO this patch is completely harmless: it allows nothing fproxy didn't 
already do as also right now you can simply append "type=text/plain" to your 
URL and thus skip the content filter.

This patch would also allow git to work with freenet without any modifications 
what-so-ever.


        David
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
URL: 
<https://emu.freenetproject.org/pipermail/devl/attachments/20080605/381db015/attachment.pgp>

Reply via email to