Skip to content

Commit

Permalink
Updated Linux fixes for Swift 3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
cipi1965 authored and dduan committed Apr 8, 2017
1 parent 16ca5f4 commit 3f64fda
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions Sources/Just/Just.swift
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,8 @@ public enum HTTPMethod: String {

extension URLResponse {
var HTTPHeaders: [String: String] {
#if os(Linux)
return (self as? HTTPURLResponse)?.allHeaderFields ?? [:]
#else
return (self as? HTTPURLResponse)?.allHeaderFields as? [String: String]
?? [:]
#endif
}
}

Expand Down Expand Up @@ -202,13 +198,8 @@ public final class HTTPResult : NSObject {
public lazy var cookies: [String: HTTPCookie] = {
let foundCookies: [HTTPCookie]
if let headers = self.response?.HTTPHeaders, let url = self.response?.url {
#if os(Linux)
foundCookies = HTTPCookie.cookies(withResponseHeaderFields: headers,
forURL: url) as [HTTPCookie]
#else
foundCookies = HTTPCookie.cookies(withResponseHeaderFields: headers,
for: url) as [HTTPCookie]
#endif
} else {
foundCookies = []
}
Expand Down

0 comments on commit 3f64fda

Please sign in to comment.