Skip to content

Commit

Permalink
Fix string splitting
Browse files Browse the repository at this point in the history
  • Loading branch information
David Dunn committed Sep 24, 2018
1 parent 794e053 commit 0d2ab9b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Sources/Kitura/CodableRouter.swift
Expand Up @@ -615,8 +615,8 @@ extension Router {
case (true, true):
/// Precondition: Path is known to contain a : character
func pathHasSingleParamIdAsSuffix(_ path: String) -> Bool {
let parameterString = path.split(separator: ":", maxSplits: 1, omittingEmptySubsequences: false)
let parameter = parameterString.count > 0 ? parameterString[1] : ""
let parameterString = path.split(separator: ":", maxSplits: 1)
let parameter = parameterString.count > 1 ? parameterString[1] : ""
return parameter == "id"
}

Expand Down

0 comments on commit 0d2ab9b

Please sign in to comment.