Skip to content

Commit

Permalink
fix: replace regex with path match for secondary links (#94)
Browse files Browse the repository at this point in the history
When I upgraded to Flask V2, I didn't realize that the `regex` matcher
seems to be gone, and now this is the only set of matchers that exist:

<img width="837" alt="image"
src="https://github.com/user-attachments/assets/596700fc-f17d-46b6-9885-f32b51067be7">

Replacing the regex matcher with `path` seems to work though:

```
% curl localhost/git/fooobar -v 2>&1 | grep Location
< Location: https://github.com/Nextdoor/fooobar
% curl localhost/git -v 2>&1 | grep Location 
< Location: https://github.com/Nextdoor
```

Co-authored-by: Matt Wise <diranged@users.noreply.github.com>
  • Loading branch information
diranged and diranged authored Oct 23, 2024
1 parent 0d2b91c commit 4604911
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def __init__(self, url_map, *items):
)
app.add_url_rule("/_edit", view_func=gogo.EditShortcutView.as_view("edit_shortcut"))
app.add_url_rule(
'/<regex(".+"):name>',
'/<path:name>',
view_func=gogo.ShortcutRedirectView.as_view("shortcut_redirect"),
)

Expand Down

0 comments on commit 4604911

Please sign in to comment.