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

Set X-Binder-Launch-Host header or binder_launch_host parameter #1307

Merged
merged 1 commit into from
Dec 17, 2019

Conversation

manics
Copy link
Member

@manics manics commented Dec 14, 2019

Set the X-Binder-Launch-Host header when pass-through proxying or the binder_launch_host query parameter when redirecting.

See jupyterhub/binderhub#1031 for the corresponding BinderHub PR.

The last step of this is to add

    def badge_base_url(handler):
        launch_host = (
            handler.request.headers.get('X-Binder-Launch-Host', '') or
            handler.get_argument('binder_launch_host', ''))
        if launch_host and not launch_host.endswith('/'):
            launch_host += '/'
        if launch_host == 'https://mybinder.org/':
            return launch_host
        return ''
    c.BinderHub.badge_base_url = badge_base_url

to the Gesis BinderHub configuration

@choldgraf
Copy link
Member

choldgraf commented Dec 16, 2019

should this wait for jupyterhub/binderhub#1031 before merging? it seems reasonable to me though I don't fully understand the implications since I'm not following that PR closely. I see @bitnik is on that thread, maybe they have thoughts here too?

@bitnik
Copy link
Contributor

bitnik commented Dec 16, 2019

yes, you are right, this has no effect if jupyterhub/binderhub#1031 is not merged

@manics
Copy link
Member Author

manics commented Dec 16, 2019

@choldgraf If you're happy with the code here I think the final signoff for this and jupyterhub/binderhub#1031 together should be for @bitnik since it's to help customise the Gesis mybinder links. It should be safe to merge them in either order since neither will have any effect unless there's also a binderhub config change, and that's only needed for Gesis.

@choldgraf
Copy link
Member

choldgraf commented Dec 16, 2019

Sounds good - in that case I am +1 when @bitnik is +1

@bitnik
Copy link
Contributor

bitnik commented Dec 17, 2019

I think we can merge this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants