Http.swift
Http.swift copied to clipboard
Cannot intercept all routes
Trying to intercept all routes:
server.get("/.*") { req -> Response in
return Response.ok("Got it")
}
doesn't work. Seems to be a bug in Regex
L23: (1..<result.numberOfRanges).forEach {
should it start with 0?
Did you try following?
server.get("/{rest}") { req in
return Response.ok("Got it")
}
But that's just a workaround. The regex should in theory catch everything but it doesn't.