Skip to content

Commit

Permalink
updated post_remote_browse to use hostname #633
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew Letter committed Aug 31, 2016
1 parent 344f33c commit 9302c5b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/slycat/web/server/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def abspath(path):
dispatcher.connect("post-projects", "/projects", slycat.web.server.handlers.post_projects, conditions={"method" : ["POST"]})

#TODO: scrub sid
dispatcher.connect("post-remote-browse", "/remotes/:sid/browse{path:.*}", slycat.web.server.handlers.post_remote_browse, conditions={"method" : ["POST"]})
dispatcher.connect("post-remote-browse", "/remotes/:hostname/browse{path:.*}", slycat.web.server.handlers.post_remote_browse, conditions={"method" : ["POST"]})
dispatcher.connect("post-remote-videos", "/remotes/:sid/videos", slycat.web.server.handlers.post_remote_videos, conditions={"method" : ["POST"]})
dispatcher.connect("post-remotes", "/remotes", slycat.web.server.handlers.post_remotes, conditions={"method" : ["POST"]})

Expand Down
3 changes: 2 additions & 1 deletion packages/slycat/web/server/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1884,7 +1884,8 @@ def run_agent_function():

@cherrypy.tools.json_in(on = True)
@cherrypy.tools.json_out(on = True)
def post_remote_browse(sid, path):
def post_remote_browse(hostname, path):
sid = get_sid(hostname)
file_reject = re.compile(cherrypy.request.json.get("file-reject")) if "file-reject" in cherrypy.request.json else None
file_allow = re.compile(cherrypy.request.json.get("file-allow")) if "file-allow" in cherrypy.request.json else None
directory_reject = re.compile(cherrypy.request.json.get("directory-reject")) if "directory-reject" in cherrypy.request.json else None
Expand Down

0 comments on commit 9302c5b

Please sign in to comment.