Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

content type fix #209

Merged
merged 12 commits into from
May 6, 2016
Merged

content type fix #209

merged 12 commits into from
May 6, 2016

Conversation

tanner0101
Copy link
Member

Deduces content types for a given file extension.

For example:

"css": "text/css"

Fixes #192

@tanner0101 tanner0101 self-assigned this May 5, 2016
@tanner0101 tanner0101 added enhancement New feature or request work in progress labels May 5, 2016
@tanner0101 tanner0101 added this to the 0.8 milestone May 5, 2016

headers["Content-Type"] = Response.Headers.Values(type.description)
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)

var headers: Response.Headers = [:]

if
let fileExtension = filePath.split(byString: ".").last,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I always want this to be func split(by string:? Do we own it

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's from Zewo/String. We can make a PR there.

@tanner0101 tanner0101 merged commit 464a5ad into master May 6, 2016
@tanner0101 tanner0101 deleted the content-type-fix branch May 6, 2016 01:52
@@ -1,4 +1,5 @@
import libc
import MediaType

public class Application {
public static let VERSION = "0.5.3"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please update the version?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, yeah. Looks like we've been forgetting to do that. I'll make an issue for the 0.8 release (milestone).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants