-
Notifications
You must be signed in to change notification settings - Fork 283
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
uri
method renders wrong path to endpoint, name
arg of route contains _
but path of this endpoint contains -
, uri
method returns path with _
and request to it returns 404 HTTP code
Minimal Reproducible Example
from fasthtml import common as fh
app, rt = fh.fast_app(live=True)
@rt("/update-remaining-limits", name="update_remaining_limits")
async def get(
htmx: fh.HtmxHeaders, _added: int = 0, _max: int = 0, _used: int = 0
):
return max(0, _max - _used + _added)
@rt("/")
def index():
return fh.uri("update_remaining_limits", _added=10, _max=30, _used=0) # ---> update_remaining_limits/_added=10&_max=30&_used=0
fh.serve()
Expected behavior
It shoud be fh.uri("update_remaining_limits") # ---> /update-remaining-limits
(with -
instaed of _
)
in accordance with the documentation https://fastht.ml/docs/ref/handlers.html#path-and-query-parameters
Environment Information
- fastlite version: 0.1.3
- fastcore version: 1.8.1
- fasthtml version: 0.12.22
Confirmation
- I have read the FAQ (https://docs.fastht.ml/explains/faq.html)
- I have provided a minimal reproducible example
- I have included the versions of fastlite, fastcore, and fasthtml
- I understand that this is a volunteer open source project with no commercial support.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working