Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Sources/express/RoutePattern.swift
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,10 @@ public enum RoutePattern {
}
}

// I don't know if this special case is the best way to handle this but there was a one off error where
// any routes that use "/" for the pattern would match all routes
if case .root = pattern[0], pattern.count == 1 && escapedPathComponents.count > 1 { return nil }

// there have to be more or the same number of components in the path like
// things to match in the pattern ...
guard escapedPathComponents.count >= pattern.count else { return nil }
Expand Down