Commit 1ce58139 authored by Stefano Alberto Russo's avatar Stefano Alberto Russo
Browse files

Added a redirect in the proxy to workaround that JS request cannot be...

Added a redirect in the proxy to workaround that JS request cannot be constructed from a URL that includes credentials.
parent 226e7bc1
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -725,6 +725,8 @@ Listen '''+str(task.tcp_tunnel_port)+'''
      AuthUserFile /shared/etc_apache2_sites_enabled/'''+str(task.uuid)+'''.htpasswd
      AuthUserFile /shared/etc_apache2_sites_enabled/'''+str(task.uuid)+'''.htpasswd
      Require valid-user
      Require valid-user


      Redirect "/ad5aad4c-f68e-4077-b92f-8d9fd8f55428" "/"

      # preserve Host header to avoid cross-origin problems
      # preserve Host header to avoid cross-origin problems
      ProxyPreserveHost on
      ProxyPreserveHost on
      # proxy to the port
      # proxy to the port
+1 −1
Original line number Original line Diff line number Diff line
@@ -1224,7 +1224,7 @@ def direct_connection_handler(request, uuid):
        if task.requires_proxy_auth and task.auth_token and not task.container.disable_http_basicauth_embedding:
        if task.requires_proxy_auth and task.auth_token and not task.container.disable_http_basicauth_embedding:
            user = request.user.email
            user = request.user.email
            password = task.auth_token
            password = task.auth_token
            redirect_string = 'https://{}:{}@{}:{}'.format(user, password, rosetta_tasks_proxy_host, task.tcp_tunnel_port)
            redirect_string = 'https://{}:{}@{}:{}/ad5aad4c-f68e-4077-b92f-8d9fd8f55428'.format(user, password, rosetta_tasks_proxy_host, task.tcp_tunnel_port)
        else:
        else:
            redirect_string = 'https://{}:{}'.format(rosetta_tasks_proxy_host, task.tcp_tunnel_port)
            redirect_string = 'https://{}:{}'.format(rosetta_tasks_proxy_host, task.tcp_tunnel_port)
    else:
    else: