Explorar el Código

Fix shareFilesFromDirectory with percent encoded path

tnantoka hace 9 años
padre
commit
2504612c41
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 {