Author: nextgens
Date: 2007-05-24 15:44:12 +0000 (Thu, 24 May 2007)
New Revision: 13358

Modified:
   trunk/freenet/src/freenet/clients/http/FProxyToadlet.java
   trunk/freenet/src/freenet/clients/http/SymlinkerToadlet.java
Log:
Revert r12999 and do it properly, now /darknet/ redirects to /friends/
We can't use the symlinkerToadlet because /darknet has no /sl/ prefix

Modified: trunk/freenet/src/freenet/clients/http/FProxyToadlet.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/FProxyToadlet.java   2007-05-24 
15:20:39 UTC (rev 13357)
+++ trunk/freenet/src/freenet/clients/http/FProxyToadlet.java   2007-05-24 
15:44:12 UTC (rev 13358)
@@ -320,6 +320,11 @@
                }else if(ks.equals("/robots.txt")){
                        this.writeReply(ctx, 400, "text/plain", "robots.txt", 
"User-agent: *\nDisallow: /");
                        return;
+               }else if(ks.startsWith("/darknet/")) { //TODO: remove when 
obsolete
+                       MultiValueTable headers = new MultiValueTable();
+                       headers.put("Location", "/friends/");
+                       ctx.sendReplyHeaders(301, "Permanent Redirect", 
headers, null, 0);
+                       return;
                }

                if(ks.startsWith("/"))

Modified: trunk/freenet/src/freenet/clients/http/SymlinkerToadlet.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/SymlinkerToadlet.java        
2007-05-24 15:20:39 UTC (rev 13357)
+++ trunk/freenet/src/freenet/clients/http/SymlinkerToadlet.java        
2007-05-24 15:44:12 UTC (rev 13358)
@@ -33,7 +33,7 @@
                        public void set(String[] val) throws 
InvalidConfigValueException {
                                //if(storeDir.equals(new File(val))) return;
                                // FIXME
-                               throw new 
InvalidConfigValueException(L10n.getString("PluginManager.cannotSetOnceLoaded"));
+                               throw new InvalidConfigValueException("Cannot 
set the plugins that's loaded.");
                        }
                });

@@ -53,7 +53,6 @@

                addLink("/sl/search/", "/plugins/plugins.Librarian/", false);
                addLink("/sl/gallery/", "/plugins/plugins.TestGallery/", false);
-               addLink("/darknet/", "/friends/", false);
        }

        public boolean addLink(String alias, String target, boolean store) {


Reply via email to