gjoseph92 / stackstac

Turn a STAC catalog into a dask-based xarray
https://stackstac.readthedocs.io
MIT License
245 stars 49 forks source link

Update base URL regex to make show with paths with 'notebook' in them #104

Closed robintw closed 2 years ago

robintw commented 2 years ago

This PR updates the regex used by the base_url_from_window_location function. This function tries to determine the base URL of the Jupyter server, but previously failed if the path to the current notebook included notebook (or lab or voila). This PR changes the regex to be a 'lazy' or 'non-greedy' regex which means it will match the first occurrence of notebook/lab/etc rather than the last - and therefore extract the correct base URL.