sauliusgrigaitis / Swifton

A Ruby on Rails inspired Web Framework for Swift that runs on Linux and OS X
MIT License
1.97k stars 70 forks source link

Router needs to return the correct mime-type for public files instead of `text/plain` #41

Closed califrench closed 8 years ago

califrench commented 8 years ago

Now that Swifton defines its own ContentTypes in Response.swift we need to add the missing mime-types in order to return the correct content-type. Returning a text/plain type causes errors on certain browsers that will only parse a file if it has the expected mime-type:

Did not parse stylesheet at 'http://localhost:8080/css/style.css' because non CSS MIME types are not allowed in strict mode.

Here's what needed: