Skip to content

Commit

Permalink
patch force unwrap
Browse files Browse the repository at this point in the history
  • Loading branch information
loganwright committed Mar 8, 2017
1 parent 364dea0 commit 0737008
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions Sources/Routing/Router+Responder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ extension Router: Responder {

private func supportedMethods(for request: Request) -> [Method] {
let request = request.copy()
let host = self.host(for: request.uri.host)
guard let host = self.host(for: request.uri.host) else { return [] }
let allOptions = host.allSubBranches
let allPossibleMethods = allOptions.map { Method($0.name) }
return allPossibleMethods.filter { method in
Expand All @@ -33,9 +33,8 @@ extension Router: Responder {
}
}

private func host(for host: String) -> Branch<Responder> {
// FIXME: RM !
return base.fetch([host])!
private func host(for host: String) -> Branch<Responder>? {
return base.fetch([host])
}
}

Expand Down

0 comments on commit 0737008

Please sign in to comment.