nbgitpuller icon indicating copy to clipboard operation
nbgitpuller copied to clipboard

Forward query string when redirecting from /git-pull/ endpoint

Open frankier opened this issue 2 years ago • 8 comments

Fixes: #290

I've been having trouble with the redirect on BinderHub when 3rd party cookies are disabled. This fowards the token query string argument which seems to fix the issue.

frankier avatar Apr 12 '23 07:04 frankier

Thanks for submitting your first pull request! You are awesome! :hugs:
If you haven't done so already, check out Jupyter's Code of Conduct. Also, please make sure you followed the pull request template, as this will help us review your contribution more quickly. welcome You can meet the other Jovyans by joining our Discourse forum. There is also a intro thread there where you can stop by and say Hi! :wave:
Welcome to the Jupyter community! :tada:

welcome[bot] avatar Apr 12 '23 07:04 welcome[bot]

I'd like to review and help this PR, but I'm not confident on the situation you look to resolve based on the PR description.

Can you describe example links where nbgitpullers behavior will changed with this PR?

consideRatio avatar Apr 12 '23 08:04 consideRatio

In Chrome/Chromium you should encounter this on BinderHub, when you disable 3rd party cookies. Do you happen to have a spare BinderHub nbgitpuller link handy?

2023-04-12T12-33-04

frankier avatar Apr 12 '23 09:04 frankier

Old / does not work with 3rd party cookies disabled:

https://mybinder.org/v2/gh/frankier/duckbook/oldnbgitpuller?urlpath=git-pull%3Frepo%3Dhttps%253A%252F%252Fgithub.com%252Ffrankier%252Fcran_licenses%26branch%3Dmain

New / based on this PR

https://mybinder.org/v2/gh/frankier/duckbook/main?urlpath=git-pull%3Frepo%3Dhttps%253A%252F%252Fgithub.com%252Ffrankier%252Fcran_licenses%26branch%3Dmain

frankier avatar Apr 13 '23 08:04 frankier

Would you say this is primarily a mybinder.org issue that could affect other applications/extensions?

Can you open your browser debug/log console, and show us all the network requests and logs for a failing redirect?

manics avatar Apr 13 '23 08:04 manics

I'm having some trouble generating working example links here because the link generator is still broken for me.

For me, the link generator is still not working. See also: https://github.com/jupyterhub/nbgitpuller/pull/297

frankier avatar Apr 13 '23 09:04 frankier

As requested...

2023-04-13T13-48-57

The above links are finally fixed now. It might be enough to use an incognito window for testing. For me, one works and one does not.

P.S.: Click them while they're warm(!) ;)

P.P.S: I think this might affect other BinderHub instances? I'm not sure about other cases.

frankier avatar Apr 13 '23 10:04 frankier

Hi! Were either of you able to replicate from my description?

frankier avatar Apr 20 '23 11:04 frankier

I've resolved conflicts now. Please let me know if anything is unclear with this PR.

frankier avatar Aug 26 '24 07:08 frankier

I still can't reproduce the error reported in https://github.com/jupyterhub/nbgitpuller/issues/290

https://mybinder.org/v2/gist/manics/7e82eefd3a72c3480af8752f5978490c/master?urlpath=git-pull%3Frepo%3Dhttps%253A%252F%252Fgithub.com%252Foctocat%252FHello-World%26urlpath%3Dtree%252FHello-World%252F%26branch%3Dmaster Works fine for me with the current release of nbgitpuller, in Google Chrome Incognito:

image image

  • Environment: https://gist.github.com/manics/7e82eefd3a72c3480af8752f5978490c
  • Content: https://github.com/octocat/Hello-World

manics avatar Aug 26 '24 12:08 manics

Well I'm not working on this anymore so I can't say exactly what went wrong. No problem if it works for you and you don't want to pass the token query string through redirects along and rely on the cookie. Maybe someone will be able to post a replicable bug later on.

frankier avatar Aug 26 '24 15:08 frankier