Commit 81b2d76a authored by Romain Courteaud's avatar Romain Courteaud

slapos_panel: ensure the url is relative to the web site, but without containing a //

parent 0c65cf07
from urlparse import urljoin from urlparse import urljoin, urlparse
portal = context.getPortalObject() portal = context.getPortalObject()
person = portal.portal_membership.getAuthenticatedMember().getUserValue() person = portal.portal_membership.getAuthenticatedMember().getUserValue()
...@@ -28,8 +28,10 @@ if slapos_master_web_url is None: ...@@ -28,8 +28,10 @@ if slapos_master_web_url is None:
# XXX this url is HARDCODED on the client side # XXX this url is HARDCODED on the client side
# and so, can not be modified # and so, can not be modified
request_url = urljoin(slapos_master_web_url, "Person_requestComputer") # ensure the url is relative to the web site, but without containing a //
request_url = urljoin(urljoin(slapos_master_web_url,
urlparse(slapos_master_web_url + '/').path.replace('//','/')),
"Person_requestComputer")
person.requestToken(request_url=request_url) person.requestToken(request_url=request_url)
access_token_id = context.REQUEST.get("token") access_token_id = context.REQUEST.get("token")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment