Explorar el Código

Merge pull request #249 from tnantoka/fix-share-files-with-space

Fix shareFilesFromDirectory with percent encoded path
Damian Kołakowski hace 8 años
padre
commit
ba623ef2a3
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      Sources/HttpRouter.swift

+ 1 - 1
Sources/HttpRouter.swift

@@ -81,7 +81,7 @@ open class HttpRouter {
     }
     
     private func findHandler(_ node: inout Node, params: inout [String: String], generator: inout IndexingIterator<[String]>) -> ((HttpRequest) -> HttpResponse)? {
-        guard let pathToken = generator.next() else {
+        guard let pathToken = generator.next()?.removingPercentEncoding else {
             // if it's the last element of the requested URL, check if there is a pattern with variable tail.
             if let variableNode = node.nodes.filter({ $0.0.characters.first == ":" }).first {
                 if variableNode.value.nodes.isEmpty {