Fixed an issue when routing empty "uriResource" inside the "handle(_: context: next: )" function for the DocCMiddleware middleware in the library target.
This commit is contained in:
@@ -70,7 +70,11 @@ struct DocCMiddleware<
|
||||
|
||||
// rule #5: Redirects URI resources with `/` to `/documentation`.
|
||||
if uriResource == .forwardSlash {
|
||||
return .redirect(to: String(format: .Format.Path.documentation, uriPath))
|
||||
return if uriPath.hasSuffix(.forwardSlash) {
|
||||
.redirect(to: String(format: .Format.Path.documentation, uriPath))
|
||||
} else {
|
||||
.redirect(to: String(format: .Format.Path.forwardSlash, uriPath))
|
||||
}
|
||||
}
|
||||
|
||||
for staticFile in StaticFile.allCases {
|
||||
|
||||
Reference in New Issue
Block a user