anya
anya
HHono
Created by anya on 6/25/2024 in #help
struggles with routing with file extensions after optional path parameters
hey! trying to figure out how to come up with the correct route definition for my use case. this is what i have now: /:one/:two/:three/:four?{.+\\.png$} my goal is to have the four parameter optional, but the URL must end with the extension regardless. so the route must match: - /one/two/three.png - /one/two/three/four.png the extension should not be included in the three / four parameters value too. any idea on how to achieve this? i was thinking of just validating and stripping off the extension in a middleware, but the request object is immutable, so i can't modify the URL
2 replies