You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Not sure if this is a bug or intentional feature. When using Blueprint route with Flask, I understand routes with trailing / can be used to handle routes with and without /. (e.g. /api/do/stuff and /api/do/stuff/.
When user enters a route /project/food/, it will return what project_category does and returns, but when user enters /project/food, it will redirect to /project/food/.
So if you don't want the redirect, you might do something like:
With the path type, even when you specify both routes, the route without the trailing / will still redirect to route with trailing / even though it is specified as a route.
Expect
I was expecting the same behavior for both string type dynamic route parameter and path type dynamic route parameter?
This discussion was converted from issue #5405 on February 07, 2024 19:05.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Context
Not sure if this is a bug or intentional feature. When using Blueprint route with Flask, I understand routes with trailing
/
can be used to handle routes with and without/
. (e.g./api/do/stuff
and/api/do/stuff/
.When you have route:
When user enters a route
/project/food/
, it will return whatproject_category
does and returns, but when user enters/project/food
, it will redirect to/project/food/
.So if you don't want the redirect, you might do something like:
Replicate
Now this works fine if the dynamic route uses
string
type, but it seem to be working differently forpath
type.With the
path
type, even when you specify both routes, the route without the trailing/
will still redirect to route with trailing/
even though it is specified as a route.Expect
I was expecting the same behavior for both
string
type dynamic route parameter andpath
type dynamic route parameter?Environment: macOS 14.3 (23D56)
Beta Was this translation helpful? Give feedback.
All reactions