This is kind of the same as #25 but that issue encompassed two issues:
- All static files were returned in a response with a "text/plain" mimeType -> Now fixed
- Media assets can't be returned because the following line failed
// Router.swift:111
...
if let body = String(data:contents!, encoding: NSUTF8StringEncoding) {
...
Any file that is a jpeg or png etc... Returns a nil body on this line which leads to this code returning a notFound Response:
// Router.swift:95
if let staticFile = serveStaticFile(newRequest) {
return staticFile as! Response
}
return notFound(newRequest) as! Response
So we are still having an issue with not returning media assets this isn't in line with the README
Static assets (JavaScript, CSS, images etc.) are loaded from Public directory by default
This is crucial and needs to be fixed before Swifton can be useful. I can't imagine a website without any media assets!
I'm willing to investigate this much further but we may need to modify the router to return ResponseTypes from the router instead of Inquiline Response types... Of course any other thoughts are welcome!
This is kind of the same as #25 but that issue encompassed two issues:
Any file that is a jpeg or png etc... Returns a nil body on this line which leads to this code returning a
notFoundResponse:So we are still having an issue with not returning media assets this isn't in line with the README
I'm willing to investigate this much further but we may need to modify the router to return
ResponseTypes from the router instead of InquilineResponsetypes... Of course any other thoughts are welcome!