From f22fc9fda056486254f10f54b5f2f965d3e0344d Mon Sep 17 00:00:00 2001 From: Christoffer Winterkvist Date: Tue, 22 Dec 2015 11:38:50 +0100 Subject: [PATCH] Fix URL or URI condition logic --- Source/Compass.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Compass.swift b/Source/Compass.swift index 6632340..716dc76 100644 --- a/Source/Compass.swift +++ b/Source/Compass.swift @@ -26,7 +26,7 @@ public struct Compass { .map(String.init)) .first else { continue } - if query.hasPrefix(prefix) || prefix.hasPrefix(query) { + if query.hasPrefix(prefix) && prefix.hasPrefix(query) { let queryString = query.stringByReplacingOccurrencesOfString(prefix, withString: "") let queryArguments = splitString(queryString, delimiter: ":") let routeArguments = splitString(route, delimiter: ":").filter { $0.containsString("{") }