소스 검색

#update - cURL representation should included additional headers in NSURLSessionConfiguration

Ryne Cheow 11 년 전
부모
커밋
3e0657c1c1
1개의 변경된 파일9개의 추가작업 그리고 0개의 파일을 삭제
  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 {
             components.append("-d \"\(NSString(data: HTTPBody, encoding: NSUTF8StringEncoding))\"")
         }