-
Notifications
You must be signed in to change notification settings - Fork 50
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
Do something when STAC endpoint url ends with "/" #369
Comments
Can you provide examples of the breakages? I just tried a couple of queries using with and without a trailing |
Yes it looks like it depends on the API. Our own API is still internal right now (we have used STAC-FastAPI out of the box) but here is another one on which I can reproduce the issue: |
That endpoint is pretty old -- it's |
Yes I have one, but not public. It consists of pgstac + stac-fastapi (built two weeks ago from the stac-fastapi repository, master branch) so I believe it is in the |
I tested against the planetary computer (https://planetarycomputer.microsoft.com/api/stac/v1), which is also pgstac + stac-fastapi, and haven't had any issues as of yet. Can you try some of your problematic queries against that endpoint, and post any results here? |
Sure. Here is what I got from scratch. Run docker image (fresh build from master branch of stac-utils/stacapi)
Run python code from another server: from pystac_client import Client
url = ...
api = Client.open(url)
print([c for c in api.get_collections()]) With Client:
STAC FastAPI server logs:
With Output:
STAC FastAPI server logs:
|
Thanks for the example! I'm now able to reproduce. Fix in #373. My tests weren't failing because https://planetarycomputer.microsoft.com/api/stac/v1/collections and https://planetarycomputer.microsoft.com/api/stac/v1//collections (notice the double slash) both work. But using a vanilla stac-fastapi I was able to reproduce the issue. |
Hi,
When the STAC enpoint ends with "/", random things crashes in pystac.
Maybe it could be more user/developer friendly to throw an exception when the enpoint is badly formed (I spent like 30 minutes figuring out why, I guess its a classic for newcomers).
Or, fix the url, or use urllib or something else to concatenate URL?
The text was updated successfully, but these errors were encountered: