Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX: Escape colon in JupyterHub link to repo #556

Merged
merged 5 commits into from
May 2, 2022

Commits on Apr 28, 2022

  1. Escape colon in JupyterHub link to repo

    I've run into a problem using The Littlest JupyterHub with current
    `sphinx-book-theme`. At the moment the generated URLs for JupyterHub are
    of form:
    
    ```
    <hub-url>/hub/user-redirect/git-pull?repo=https://<repo>&urlpath=tree/<nb_fname>
    ```
    
    These work fine on a modern Kubernetes JupyterHub, I guess because of
    a recent version of JupyterHub responding to the query.
    
    But, on current The Littlest JupyterHub, still on JupyterHub 1.5.0, this
    causes Nbgitpuller to stall if the user is not already logged in, with
    log messages of form:
    
    ```
    Disallowing redirect outside JupyterHub:
    '/hub/user-redirect/git-pull?repo=https://github.com/<repo>&urlpath=tree/<nb_fname>'.
    ```
    
    Once logged in, retrying the same link works correctly.
    
    This can be fixed by escaping the `:` in the Nbgitpuller URL with a
    `%3A`, in this PR.
    matthew-brett committed Apr 28, 2022
    Configuration menu
    Copy the full SHA
    e6896bb View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    910bd97 View commit details
    Browse the repository at this point in the history
  3. Adapt tests to URL escape

    Replace : with %3A in test files, to match escaping behavior.
    
    Note: the file `test_topbar_launchbtns.html` does not appear to have
    tests that check the URL.
    matthew-brett committed Apr 28, 2022
    Configuration menu
    Copy the full SHA
    b367eed View commit details
    Browse the repository at this point in the history

Commits on May 2, 2022

  1. Use urlencode from suggestion by MinRK

    Generalize URL encoding using urlencode function.
    matthew-brett committed May 2, 2022
    Configuration menu
    Copy the full SHA
    b859ff9 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    823e1a4 View commit details
    Browse the repository at this point in the history