Skip to content

Commit

Permalink
chore: add comment explaining why we use the regex to filter guid rou…
Browse files Browse the repository at this point in the history
…tes on %O
  • Loading branch information
64J0 committed May 12, 2024
1 parent b57fac8 commit d7188c7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Giraffe/EndpointRouting.fs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ open FSharp.Core
open Giraffe

module private RouteTemplateBuilder =
// We use this regex route constraint to be compatible with Giraffe's default router,
// which supports ShortGuid's.
// More information on ASP.NET route constraints:
// https://learn.microsoft.com/en-us/aspnet/core/fundamentals/routing?view=aspnetcore-8.0#route-constraints
let private guidPattern =
"^[0-9A-Fa-f]{{8}}-[0-9A-Fa-f]{{4}}-[0-9A-Fa-f]{{4}}-[0-9A-Fa-f]{{4}}-[0-9A-Fa-f]{{12}}$|^[0-9A-Fa-f]{{32}}$|^[-_0-9A-Za-z]{{22}}$"
let private shortIdPattern =
Expand Down

0 comments on commit d7188c7

Please sign in to comment.