Browse Source

Merge pull request #140 from rynecheow/master

cURL representation should included additional headers in NSUR...
Mattt Thompson 11 years ago
parent
commit
06349a4061
1 changed files with 9 additions and 0 deletions
  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 {
         if let HTTPBody = request.HTTPBody {
             components.append("-d \"\(NSString(data: HTTPBody, encoding: NSUTF8StringEncoding))\"")
             components.append("-d \"\(NSString(data: HTTPBody, encoding: NSUTF8StringEncoding))\"")
         }
         }