Added encoding to auth token when is passed as request parameter in GET
authorChristos Stathis <chstath@ebs.gr>
Thu, 16 Feb 2012 13:26:33 +0000 (15:26 +0200)
committerChristos Stathis <chstath@ebs.gr>
Thu, 16 Feb 2012 13:26:33 +0000 (15:26 +0200)
src/gr/grnet/pithos/web/client/FileContextMenu.java
src/gr/grnet/pithos/web/client/FileList.java
src/gr/grnet/pithos/web/client/ToolsMenu.java

index 6273de7..b19bde5 100644 (file)
@@ -47,6 +47,7 @@ import gr.grnet.pithos.web.client.foldertree.Folder;
 
 import java.util.List;
 
+import com.google.gwt.http.client.URL;
 import com.google.gwt.resources.client.ClientBundle;
 import com.google.gwt.resources.client.ImageResource;
 import com.google.gwt.user.client.Command;
@@ -248,7 +249,7 @@ public class FileContextMenu extends PopupPanel {
                        @Override
                        public void execute() {
                                for (File f : selectedFiles)
-                                       Window.open(app.getApiPath() + f.getOwner() + f.getUri() + "?X-Auth-Token=" + app.getToken(), "_blank", "");
+                                       Window.open(app.getApiPath() + f.getOwner() + f.getUri() + "?X-Auth-Token=" + URL.encodeQueryString(app.getToken()), "_blank", "");
                        }
                }));
 
index f9b4d21..ed4fd2a 100644 (file)
@@ -52,6 +52,7 @@ import com.google.gwt.cell.client.ValueUpdater;
 import com.google.gwt.core.client.GWT;
 import com.google.gwt.event.dom.client.ContextMenuEvent;
 import com.google.gwt.event.dom.client.ContextMenuHandler;
+import com.google.gwt.http.client.URL;
 import com.google.gwt.i18n.client.DateTimeFormat;
 import com.google.gwt.resources.client.ImageResource;
 import com.google.gwt.safehtml.client.SafeHtmlTemplates;
@@ -383,7 +384,7 @@ public class FileList extends Composite {
                if (DOM.eventGetType(event) == Event.ONDBLCLICK)
                        if (getSelectedFiles().size() == 1) {
                                File file = getSelectedFiles().get(0);
-                               Window.open(app.getApiPath() + file.getOwner() + file.getUri() + "?X-Auth-Token=" + app.getToken(), "_blank", "");
+                               Window.open(app.getApiPath() + file.getOwner() + file.getUri() + "?X-Auth-Token=" + URL.encodeQueryString(app.getToken()), "_blank", "");
                                event.preventDefault();
                                return;
                        }
index aa6eecb..1e409c7 100644 (file)
@@ -54,6 +54,7 @@ import gr.grnet.pithos.web.client.grouptree.User;
 
 import java.util.List;
 
+import com.google.gwt.http.client.URL;
 import com.google.gwt.user.client.Command;
 import com.google.gwt.user.client.Window;
 import com.google.gwt.user.client.ui.AbstractImagePrototype;
@@ -192,7 +193,7 @@ public class ToolsMenu extends PopupPanel {
                                                        @Override
                                                        public void execute() {
                                                        for (File f: files)
-                                                               Window.open(app.getApiPath() + f.getOwner() + f.getUri() + "?X-Auth-Token=" + app.getToken(), "_blank", "");
+                                                               Window.open(app.getApiPath() + f.getOwner() + f.getUri() + "?X-Auth-Token=" + URL.encodeQueryString(app.getToken()), "_blank", "");
                                                        }
                                                }));
                                        empty = false;