Преглед на файлове

Add Content-Type to HttpBody and Text HttpResponse

mtgto преди 5 години
родител
ревизия
31346bed68
променени са 1 файла, в които са добавени 2 реда и са изтрити 1 реда
  1. 2 1
      XCode/Sources/HttpResponse.swift

+ 2 - 1
XCode/Sources/HttpResponse.swift

@@ -136,7 +136,8 @@ public enum HttpResponse {
         case .ok(let body):
             switch body {
             case .json: headers["Content-Type"] = "application/json"
-            case .html: headers["Content-Type"] = "text/html"
+            case .html, .htmlBody: headers["Content-Type"] = "text/html"
+            case .text: headers["Content-Type"] = "text/plain"
             case .data(_, let contentType): headers["Content-Type"] = contentType
             default:break
             }