Skip to content

Commit

Permalink
Switching over to using hostname instead of session. Addresses #633
Browse files Browse the repository at this point in the history
  • Loading branch information
alexsielicki committed Aug 24, 2016
1 parent 722d404 commit 432437c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/slycat/web/server/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def get_sid(hostname):
sid = host_session["sid"]
break
except Exception as e:
cherrypy.log.error("could retrieve host session for remotes %s" % e)
cherrypy.log.error("could not retrieve host session for remotes %s" % e)
raise cherrypy.HTTPError("404")
if sid is None:
raise cherrypy.HTTPError("400 session is None value")
Expand Down
4 changes: 2 additions & 2 deletions web-server/js/slycat-remotes.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ define("slycat-remotes", ["slycat-server-root", "slycat-web-client", "knockout",
if(params.hostname in remotes)
{
if(params.success)
params.success(remotes[params.hostname]);
params.success(params.hostname);
return;
}

Expand All @@ -80,7 +80,7 @@ define("slycat-remotes", ["slycat-server-root", "slycat-web-client", "knockout",
{
remotes[params.hostname] = sid;
if(params.success)
params.success(sid);
params.success(params.hostname);
},
cancel: function()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1572,7 +1572,7 @@ define("slycat-parameter-image-scatterplot", ["slycat-server-root", "d3", "URI",
}})(image, frame));
self.login_open = false;
},
success: function(sid) {
success: function(hostname) {
var xhr = new XMLHttpRequest();
var api = "/file";
if(self.options.video_file_extensions.indexOf(uri.suffix()) > -1) {
Expand All @@ -1581,7 +1581,7 @@ define("slycat-parameter-image-scatterplot", ["slycat-server-root", "d3", "URI",

xhr.image = image;
//Double encode to avoid cherrypy's auto unencode in the controller
xhr.open("GET", server_root + "remotes/" + sid + api + uri.pathname() + "?cache=project&project=" + model.project + "&key=" + URI.encode(URI.encode(uri.host() + uri.path())), true);
xhr.open("GET", server_root + "remotes/" + hostname + api + uri.pathname() + "?cache=project&project=" + model.project + "&key=" + URI.encode(URI.encode(uri.host() + uri.path())), true);
xhr.responseType = "arraybuffer";
xhr.onload = function(e) {
// If we get 404, the remote session no longer exists because it timed-out.
Expand Down

0 comments on commit 432437c

Please sign in to comment.