Explorar el Código

Merge pull request #140 from rynecheow/master

cURL representation should included additional headers in NSUR...
Mattt Thompson hace 11 años
padre
commit
06349a4061
Se han modificado 1 ficheros con 9 adiciones y 0 borrados
  1. 9 0
      Source/Alamofire.swift

+ 9 - 0
Source/Alamofire.swift

@@ -1251,6 +1251,15 @@ extension Request: DebugPrintable {
             }
         }
 
+        for (field, value) in session.configuration.HTTPAdditionalHeaders! {
+            switch field {
+            case "Cookie":
+                continue
+            default:
+                components.append("-H \"\(field): \(value)\"")
+            }
+        }
+        
         if let HTTPBody = request.HTTPBody {
             components.append("-d \"\(NSString(data: HTTPBody, encoding: NSUTF8StringEncoding))\"")
         }