Skip to content

Commit

Permalink
Disable curl's Expect header (#294)
Browse files Browse the repository at this point in the history
  • Loading branch information
djones6 authored Mar 5, 2019
1 parent 8ddc7ea commit d837d45
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Sources/KituraNet/ClientRequest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,11 @@ public class ClientRequest {
if closeConnection {
headers["Connection"] = "close"
}

// Unless the user has provided an Expect header, set an empty one to disable
// curl's default Expect: 100-continue behaviour, since Kitura does not support it.
if !headers.keys.contains("Expect") {
headers["Expect"] = ""
}
for (headerKey, headerValue) in headers {
if let headerString = "\(headerKey): \(headerValue)".cString(using: .utf8) {
headersList = curl_slist_append(headersList, UnsafePointer(headerString))
Expand Down

0 comments on commit d837d45

Please sign in to comment.