Browse Source

#update - cURL representation should included additional headers in NSURLSessionConfiguration

Ryne Cheow 11 years ago
parent
commit
3e0657c1c1
1 changed files with 9 additions and 0 deletions
  1. 9 0
      Source/Alamofire.swift

+ 9 - 0
Source/Alamofire.swift

@@ -1246,6 +1246,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))\"")
         }
         }