Skip to content

Commit 6739e9e

Browse files
committed
Merge branch 'stable' into wildcard-end-route
2 parents b9e9dd2 + 718f82c commit 6739e9e

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ All notable changes to this project will be documented in this file. Changes not
1919
# [Unreleased]
2020

2121
## Added
22-
* Add support for using `**` as a catch-all at the end of a route. ([#479](https://github.com/httpswift/swifter/pull/479)) by [@michaelenger](https://github.com/michaelenger)
22+
- Add support for using `**` as a catch-all at the end of a route. ([#479](https://github.com/httpswift/swifter/pull/479)) by [@michaelenger](https://github.com/michaelenger)
23+
- Set `Content-Type` to HttpBody and Text HttpResponse. ([#474](https://github.com/httpswift/swifter/pull/474)) by [@mtgto](https://github.com/mtgto)
2324

2425
## Fixed
2526

Xcode/Sources/HttpResponse.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,8 @@ public enum HttpResponse {
136136
case .ok(let body):
137137
switch body {
138138
case .json: headers["Content-Type"] = "application/json"
139-
case .html: headers["Content-Type"] = "text/html"
139+
case .html, .htmlBody: headers["Content-Type"] = "text/html"
140+
case .text: headers["Content-Type"] = "text/plain"
140141
case .data(_, let contentType): headers["Content-Type"] = contentType
141142
default:break
142143
}

0 commit comments

Comments
 (0)