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

latest version of Starlette (fastapi>=0.94) breaking changes #606

Closed
vincentsarago opened this issue Mar 14, 2023 · 0 comments · Fixed by #607
Closed

latest version of Starlette (fastapi>=0.94) breaking changes #606

vincentsarago opened this issue Mar 14, 2023 · 0 comments · Fixed by #607
Labels
bug Something isn't working

Comments

@vincentsarago
Copy link
Member

in starlette >=0.26 there was an introduction of a breaking change for the url_path_for url_for methods which now returns URL class instance instead of a string : encode/starlette#1385

this breaks TiTIler in place like

tiles_url = self.url_for(request, "tile", **route_params)
qs_key_to_remove = [
"tilematrixsetid",
"tile_format",
"tile_scale",
"minzoom",
"maxzoom",
"service",
"request",
]
qs = [
(key, value)
for (key, value) in request.query_params._list
if key.lower() not in qs_key_to_remove
]
if qs:
tiles_url += f"?{urlencode(qs)}"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant