ソースを参照

Converted all HTTP requests to HTTPS requests to better align with ATS.

Christian Noon 10 年 前
コミット
eac5d7643b

+ 7 - 8
Alamofire.playground/section-1.swift

@@ -1,14 +1,13 @@
-import XCPlayground
-import Foundation
 import Alamofire
+import Foundation
+import XCPlayground
 
 // Allow network requests to complete
 XCPSetExecutionShouldContinueIndefinitely()
 
-Alamofire.request(.GET, URLString: "http://httpbin.org/get", parameters: ["foo": "bar"])
-         .responseString { (request, response, string, error) in
-            print(request)
-            print(response)
-            print(string)
+Alamofire.request(.GET, "https://httpbin.org/get", parameters: ["foo": "bar"])
+         .responseString { request, response, string, _ in
+             print(request)
+             print(response)
+             print(string)
          }
-

+ 3 - 3
Source/Alamofire.swift

@@ -38,9 +38,9 @@ public protocol URLStringConvertible {
 
         Methods accepting a `URLStringConvertible` type parameter parse it according to RFCs 1738 and 1808.
 
-        See http://tools.ietf.org/html/rfc2396
-        See http://tools.ietf.org/html/rfc1738
-        See http://tools.ietf.org/html/rfc1808
+        See https://tools.ietf.org/html/rfc2396
+        See https://tools.ietf.org/html/rfc1738
+        See https://tools.ietf.org/html/rfc1808
     */
     var URLString: String { get }
 }

+ 3 - 3
Source/Manager.swift

@@ -45,10 +45,10 @@ public class Manager {
         - returns: The default header values.
     */
     public static let defaultHTTPHeaders: [String: String] = {
-        // Accept-Encoding HTTP Header; see http://tools.ietf.org/html/rfc7230#section-4.2.3
+        // Accept-Encoding HTTP Header; see https://tools.ietf.org/html/rfc7230#section-4.2.3
         let acceptEncoding: String = "gzip;q=1.0,compress;q=0.5"
 
-        // Accept-Language HTTP Header; see http://tools.ietf.org/html/rfc7231#section-5.3.5
+        // Accept-Language HTTP Header; see https://tools.ietf.org/html/rfc7231#section-5.3.5
         let acceptLanguage: String = {
             var components: [String] = []
             for (index, languageCode) in (NSLocale.preferredLanguages() as [String]).enumerate() {
@@ -62,7 +62,7 @@ public class Manager {
             return ",".join(components)
         }()
 
-        // User-Agent Header; see http://tools.ietf.org/html/rfc7231#section-5.5.3
+        // User-Agent Header; see https://tools.ietf.org/html/rfc7231#section-5.5.3
         let userAgent: String = {
             if let info = NSBundle.mainBundle().infoDictionary {
                 let executable: AnyObject = info[kCFBundleExecutableKey as String] ?? "Unknown"

+ 3 - 3
Source/MultipartFormData.swift

@@ -38,9 +38,9 @@ import CoreServices
     For more information on `multipart/form-data` in general, please refer to the RFC-2388 and RFC-2045 specs as well
     and the w3 form documentation.
 
-    - http://www.ietf.org/rfc/rfc2388.txt
-    - http://www.ietf.org/rfc/rfc2045.txt
-    - http://www.w3.org/TR/html401/interact/forms.html#h-17.13
+    - https://www.ietf.org/rfc/rfc2388.txt
+    - https://www.ietf.org/rfc/rfc2045.txt
+    - https://www.w3.org/TR/html401/interact/forms.html#h-17.13
 */
 public class MultipartFormData {
 

+ 1 - 1
Source/ParameterEncoding.swift

@@ -25,7 +25,7 @@ import Foundation
 /**
     HTTP method definitions.
 
-    See http://tools.ietf.org/html/rfc7231#section-4.3
+    See https://tools.ietf.org/html/rfc7231#section-4.3
 */
 public enum Method: String {
     case OPTIONS, GET, HEAD, POST, PUT, PATCH, DELETE, TRACE, CONNECT

+ 2 - 2
Tests/AuthenticationTests.swift

@@ -47,7 +47,7 @@ class AuthenticationTestCase: BaseTestCase {
 class BasicAuthenticationTestCase: AuthenticationTestCase {
     override func setUp() {
         super.setUp()
-        URLString = "http://httpbin.org/basic-auth/\(user)/\(password)"
+        URLString = "https://httpbin.org/basic-auth/\(user)/\(password)"
     }
 
     func testHTTPBasicAuthenticationWithInvalidCredentials() {
@@ -120,7 +120,7 @@ class HTTPDigestAuthenticationTestCase: AuthenticationTestCase {
 
     override func setUp() {
         super.setUp()
-        URLString = "http://httpbin.org/digest-auth/\(qop)/\(user)/\(password)"
+        URLString = "https://httpbin.org/digest-auth/\(qop)/\(user)/\(password)"
     }
 
     func testHTTPDigestAuthenticationWithInvalidCredentials() {

+ 1 - 1
Tests/CacheTests.swift

@@ -73,7 +73,7 @@ class CacheTestCase: BaseTestCase {
     var URLCache: NSURLCache!
     var manager: Manager!
 
-    let URLString = "http://httpbin.org/response-headers"
+    let URLString = "https://httpbin.org/response-headers"
     let requestTimeout: NSTimeInterval = 30
 
     var requests: [String: NSURLRequest] = [:]

+ 4 - 4
Tests/DownloadTests.swift

@@ -30,7 +30,7 @@ class DownloadInitializationTestCase: BaseTestCase {
 
     func testDownloadClassMethodWithMethodURLAndDestination() {
         // Given
-        let URLString = "http://httpbin.org/"
+        let URLString = "https://httpbin.org/"
         let destination = Request.suggestedDownloadDestination(directory: searchPathDirectory, domain: searchPathDomain)
 
         // When
@@ -45,7 +45,7 @@ class DownloadInitializationTestCase: BaseTestCase {
 
     func testDownloadClassMethodWithMethodURLHeadersAndDestination() {
         // Given
-        let URLString = "http://httpbin.org/"
+        let URLString = "https://httpbin.org/"
         let destination = Request.suggestedDownloadDestination(directory: searchPathDirectory, domain: searchPathDomain)
 
         // When
@@ -72,7 +72,7 @@ class DownloadResponseTestCase: BaseTestCase {
     func testDownloadRequest() {
         // Given
         let numberOfLines = 100
-        let URLString = "http://httpbin.org/stream/\(numberOfLines)"
+        let URLString = "https://httpbin.org/stream/\(numberOfLines)"
 
         let destination = Alamofire.Request.suggestedDownloadDestination(directory: searchPathDirectory, domain: searchPathDomain)
 
@@ -140,7 +140,7 @@ class DownloadResponseTestCase: BaseTestCase {
     func testDownloadRequestWithProgress() {
         // Given
         let randomBytes = 4 * 1024 * 1024
-        let URLString = "http://httpbin.org/bytes/\(randomBytes)"
+        let URLString = "https://httpbin.org/bytes/\(randomBytes)"
 
         let fileManager = NSFileManager.defaultManager()
         let directory = fileManager.URLsForDirectory(searchPathDirectory, inDomains: self.searchPathDomain)[0]

+ 3 - 3
Tests/ManagerTests.swift

@@ -30,7 +30,7 @@ class ManagerTestCase: BaseTestCase {
         let manager = Alamofire.Manager()
         manager.startRequestsImmediately = false
 
-        let URL = NSURL(string: "http://httpbin.org/get")!
+        let URL = NSURL(string: "https://httpbin.org/get")!
         let URLRequest = NSURLRequest(URL: URL)
 
         let expectation = expectationWithDescription("\(URL)")
@@ -57,7 +57,7 @@ class ManagerTestCase: BaseTestCase {
         var manager: Manager? = Alamofire.Manager()
         manager?.startRequestsImmediately = false
 
-        let URL = NSURL(string: "http://httpbin.org/get")!
+        let URL = NSURL(string: "https://httpbin.org/get")!
         let URLRequest = NSURLRequest(URL: URL)
 
         // When
@@ -74,7 +74,7 @@ class ManagerTestCase: BaseTestCase {
         var manager: Manager? = Alamofire.Manager()
         manager!.startRequestsImmediately = false
 
-        let URL = NSURL(string: "http://httpbin.org/get")!
+        let URL = NSURL(string: "https://httpbin.org/get")!
         let URLRequest = NSURLRequest(URL: URL)
 
         // When

+ 4 - 4
Tests/ParameterEncodingTests.swift

@@ -25,7 +25,7 @@ import Foundation
 import XCTest
 
 class ParameterEncodingTestCase: BaseTestCase {
-    let URLRequest = NSURLRequest(URL: NSURL(string: "http://example.com/")!)
+    let URLRequest = NSURLRequest(URL: NSURL(string: "https://example.com/")!)
 }
 
 // MARK: -
@@ -317,7 +317,7 @@ class URLParameterEncodingTestCase: ParameterEncodingTestCase {
 
     func testURLParameterEncodeStringForRequestWithPrecomposedQuery() {
         // Given
-        let URL = NSURL(string: "http://example.com/movies?hd=[1]")!
+        let URL = NSURL(string: "https://example.com/movies?hd=[1]")!
         let parameters = ["page": "0"]
 
         // When
@@ -329,7 +329,7 @@ class URLParameterEncodingTestCase: ParameterEncodingTestCase {
 
     func testURLParameterEncodeStringWithPlusKeyStringWithPlusValueParameterForRequestWithPrecomposedQuery() {
         // Given
-        let URL = NSURL(string: "http://example.com/movie?hd=[1]")!
+        let URL = NSURL(string: "https://example.com/movie?hd=[1]")!
         let parameters = ["+foo+": "+bar+"]
 
         // When
@@ -549,7 +549,7 @@ class CustomParameterEncodingTestCase: ParameterEncodingTestCase {
         let encoding: ParameterEncoding = .Custom(encodingClosure)
 
         // Then
-        let URL = NSURL(string: "http://example.com")!
+        let URL = NSURL(string: "https://example.com")!
         let URLRequest = NSURLRequest(URL: URL)
         let parameters: [String: AnyObject] = [:]
 

+ 15 - 15
Tests/RequestTests.swift

@@ -27,7 +27,7 @@ import XCTest
 class RequestInitializationTestCase: BaseTestCase {
     func testRequestClassMethodWithMethodAndURL() {
         // Given
-        let URLString = "http://httpbin.org/"
+        let URLString = "https://httpbin.org/"
 
         // When
         let request = Alamofire.request(.GET, URLString)
@@ -41,7 +41,7 @@ class RequestInitializationTestCase: BaseTestCase {
 
     func testRequestClassMethodWithMethodAndURLAndParameters() {
         // Given
-        let URLString = "http://httpbin.org/get"
+        let URLString = "https://httpbin.org/get"
 
         // When
         let request = Alamofire.request(.GET, URLString, parameters: ["foo": "bar"])
@@ -56,7 +56,7 @@ class RequestInitializationTestCase: BaseTestCase {
 
     func testRequestClassMethodWithMethodURLParametersAndHeaders() {
         // Given
-        let URLString = "http://httpbin.org/get"
+        let URLString = "https://httpbin.org/get"
 
         // When
         let request = Alamofire.request(.GET, URLString, parameters: ["foo": "bar"], headers: ["Authorization": "123456"])
@@ -79,7 +79,7 @@ class RequestInitializationTestCase: BaseTestCase {
 class RequestResponseTestCase: BaseTestCase {
     func testRequestResponse() {
         // Given
-        let URLString = "http://httpbin.org/get"
+        let URLString = "https://httpbin.org/get"
         let serializer = Request.stringResponseSerializer(encoding: NSUTF8StringEncoding)
 
         let expectation = expectationWithDescription("GET request should succeed: \(URLString)")
@@ -112,7 +112,7 @@ class RequestResponseTestCase: BaseTestCase {
     func testRequestResponseWithProgress() {
         // Given
         let randomBytes = 4 * 1024 * 1024
-        let URLString = "http://httpbin.org/bytes/\(randomBytes)"
+        let URLString = "https://httpbin.org/bytes/\(randomBytes)"
 
         let expectation = expectationWithDescription("Bytes download progress should be reported: \(URLString)")
 
@@ -179,7 +179,7 @@ class RequestResponseTestCase: BaseTestCase {
     func testRequestResponseWithStream() {
         // Given
         let randomBytes = 4 * 1024 * 1024
-        let URLString = "http://httpbin.org/bytes/\(randomBytes)"
+        let URLString = "https://httpbin.org/bytes/\(randomBytes)"
 
         let expectation = expectationWithDescription("Bytes download progress should be reported: \(URLString)")
 
@@ -274,7 +274,7 @@ extension Request {
 class RequestExtensionTestCase: BaseTestCase {
     func testThatRequestExtensionHasAccessToTaskDelegateQueue() {
         // Given
-        let URLString = "http://httpbin.org/get"
+        let URLString = "https://httpbin.org/get"
         let expectation = expectationWithDescription("GET request should succeed: \(URLString)")
 
         var responses: [String] = []
@@ -311,7 +311,7 @@ class RequestExtensionTestCase: BaseTestCase {
 class RequestDescriptionTestCase: BaseTestCase {
     func testRequestDescription() {
         // Given
-        let URLString = "http://httpbin.org/get"
+        let URLString = "https://httpbin.org/get"
         let request = Alamofire.request(.GET, URLString)
         let initialRequestDescription = request.description
 
@@ -331,8 +331,8 @@ class RequestDescriptionTestCase: BaseTestCase {
         waitForExpectationsWithTimeout(defaultTimeout, handler: nil)
 
         // Then
-        XCTAssertEqual(initialRequestDescription, "GET http://httpbin.org/get", "incorrect request description")
-        XCTAssertEqual(finalRequestDescription ?? "", "GET http://httpbin.org/get (\(response?.statusCode ?? -1))", "incorrect request description")
+        XCTAssertEqual(initialRequestDescription, "GET https://httpbin.org/get", "incorrect request description")
+        XCTAssertEqual(finalRequestDescription ?? "", "GET https://httpbin.org/get (\(response?.statusCode ?? -1))", "incorrect request description")
     }
 }
 
@@ -361,7 +361,7 @@ class RequestDebugDescriptionTestCase: BaseTestCase {
 
     func testGETRequestDebugDescription() {
         // Given
-        let URLString = "http://httpbin.org/get"
+        let URLString = "https://httpbin.org/get"
 
         // When
         let request = manager.request(.GET, URLString)
@@ -375,7 +375,7 @@ class RequestDebugDescriptionTestCase: BaseTestCase {
 
     func testPOSTRequestDebugDescription() {
         // Given
-        let URLString = "http://httpbin.org/post"
+        let URLString = "https://httpbin.org/post"
 
         // When
         let request = manager.request(.POST, URLString)
@@ -389,7 +389,7 @@ class RequestDebugDescriptionTestCase: BaseTestCase {
 
     func testPOSTRequestWithJSONParametersDebugDescription() {
         // Given
-        let URLString = "http://httpbin.org/post"
+        let URLString = "https://httpbin.org/post"
 
         // When
         let request = manager.request(.POST, URLString, parameters: ["foo": "bar"], encoding: .JSON)
@@ -405,7 +405,7 @@ class RequestDebugDescriptionTestCase: BaseTestCase {
 
     func testPOSTRequestWithCookieDebugDescription() {
         // Given
-        let URLString = "http://httpbin.org/post"
+        let URLString = "https://httpbin.org/post"
 
         let properties = [
             NSHTTPCookieDomain: "httpbin.org",
@@ -430,7 +430,7 @@ class RequestDebugDescriptionTestCase: BaseTestCase {
 
     func testPOSTRequestWithCookiesDisabledDebugDescription() {
         // Given
-        let URLString = "http://httpbin.org/post"
+        let URLString = "https://httpbin.org/post"
 
         let properties = [
             NSHTTPCookieDomain: "httpbin.org",

+ 14 - 14
Tests/ResponseTests.swift

@@ -27,7 +27,7 @@ import XCTest
 class JSONResponseTestCase: BaseTestCase {
     func testGETRequestJSONResponse() {
         // Given
-        let URLString = "http://httpbin.org/get"
+        let URLString = "https://httpbin.org/get"
         let expectation = expectationWithDescription("\(URLString)")
 
         var request: NSURLRequest?
@@ -55,7 +55,7 @@ class JSONResponseTestCase: BaseTestCase {
         XCTAssertNil(error, "error should be nil")
 
         // The `as NSString` cast is necessary due to a compiler bug. See the following rdar for more info.
-        // - http://openradar.appspot.com/radar?id=5517037090635776
+        // - https://openradar.appspot.com/radar?id=5517037090635776
         if let args = JSON?["args" as NSString] as? [String: String] {
             XCTAssertEqual(args, ["foo": "bar"], "args should match parameters")
         } else {
@@ -65,7 +65,7 @@ class JSONResponseTestCase: BaseTestCase {
 
     func testPOSTRequestJSONResponse() {
         // Given
-        let URLString = "http://httpbin.org/post"
+        let URLString = "https://httpbin.org/post"
         let expectation = expectationWithDescription("\(URLString)")
 
         var request: NSURLRequest?
@@ -93,7 +93,7 @@ class JSONResponseTestCase: BaseTestCase {
         XCTAssertNil(error, "error should be nil")
 
         // The `as NSString` cast is necessary due to a compiler bug. See the following rdar for more info.
-        // - http://openradar.appspot.com/radar?id=5517037090635776
+        // - https://openradar.appspot.com/radar?id=5517037090635776
         if let form = JSON?["form" as NSString] as? [String: String] {
             XCTAssertEqual(form, ["foo": "bar"], "form should match parameters")
         } else {
@@ -107,8 +107,8 @@ class JSONResponseTestCase: BaseTestCase {
 class RedirectResponseTestCase: BaseTestCase {
     func testThatRequestWillPerformHTTPRedirectionByDefault() {
         // Given
-        let redirectURLString = "http://www.apple.com"
-        let URLString = "http://httpbin.org/redirect-to?url=\(redirectURLString)"
+        let redirectURLString = "https://www.apple.com"
+        let URLString = "https://httpbin.org/redirect-to?url=\(redirectURLString)"
 
         let expectation = expectationWithDescription("Request should redirect to \(redirectURLString)")
 
@@ -142,8 +142,8 @@ class RedirectResponseTestCase: BaseTestCase {
 
     func testThatRequestWillPerformRedirectionMultipleTimesByDefault() {
         // Given
-        let redirectURLString = "http://httpbin.org/get"
-        let URLString = "http://httpbin.org/redirect/5"
+        let redirectURLString = "https://httpbin.org/get"
+        let URLString = "https://httpbin.org/redirect/5"
 
         let expectation = expectationWithDescription("Request should redirect to \(redirectURLString)")
 
@@ -177,8 +177,8 @@ class RedirectResponseTestCase: BaseTestCase {
 
     func testThatTaskOverrideClosureCanPerformHTTPRedirection() {
         // Given
-        let redirectURLString = "http://www.apple.com"
-        let URLString = "http://httpbin.org/redirect-to?url=\(redirectURLString)"
+        let redirectURLString = "https://www.apple.com"
+        let URLString = "https://httpbin.org/redirect-to?url=\(redirectURLString)"
 
         let expectation = expectationWithDescription("Request should redirect to \(redirectURLString)")
         let delegate: Alamofire.Manager.SessionDelegate = Alamofire.Manager.sharedInstance.delegate
@@ -217,8 +217,8 @@ class RedirectResponseTestCase: BaseTestCase {
 
     func testThatTaskOverrideClosureCanCancelHTTPRedirection() {
         // Given
-        let redirectURLString = "http://www.apple.com"
-        let URLString = "http://httpbin.org/redirect-to?url=\(redirectURLString)"
+        let redirectURLString = "https://www.apple.com"
+        let URLString = "https://httpbin.org/redirect-to?url=\(redirectURLString)"
 
         let expectation = expectationWithDescription("Request should not redirect to \(redirectURLString)")
         let delegate: Alamofire.Manager.SessionDelegate = Alamofire.Manager.sharedInstance.delegate
@@ -257,8 +257,8 @@ class RedirectResponseTestCase: BaseTestCase {
 
     func testThatTaskOverrideClosureIsCalledMultipleTimesForMultipleHTTPRedirects() {
         // Given
-        let redirectURLString = "http://httpbin.org/get"
-        let URLString = "http://httpbin.org/redirect/5"
+        let redirectURLString = "https://httpbin.org/get"
+        let URLString = "https://httpbin.org/redirect/5"
 
         let expectation = expectationWithDescription("Request should redirect to \(redirectURLString)")
         let delegate: Alamofire.Manager.SessionDelegate = Alamofire.Manager.sharedInstance.delegate

+ 1 - 1
Tests/URLProtocolTests.swift

@@ -123,7 +123,7 @@ class URLProtocolTestCase: BaseTestCase {
 
     func testThatURLProtocolReceivesRequestHeadersAndNotSessionConfigurationHeaders() {
         // Given
-        let URLString = "http://httpbin.org/response-headers"
+        let URLString = "https://httpbin.org/response-headers"
         let URL = NSURL(string: URLString)!
         let parameters = ["URLRequest-Header": "foobar"]
 

+ 15 - 15
Tests/UploadTests.swift

@@ -27,7 +27,7 @@ import XCTest
 class UploadFileInitializationTestCase: BaseTestCase {
     func testUploadClassMethodWithMethodURLAndFile() {
         // Given
-        let URLString = "http://httpbin.org/"
+        let URLString = "https://httpbin.org/"
         let imageURL = URLForResource("rainbow", withExtension: "jpg")
 
         // When
@@ -42,7 +42,7 @@ class UploadFileInitializationTestCase: BaseTestCase {
 
     func testUploadClassMethodWithMethodURLHeadersAndFile() {
         // Given
-        let URLString = "http://httpbin.org/"
+        let URLString = "https://httpbin.org/"
         let imageURL = URLForResource("rainbow", withExtension: "jpg")
 
         // When
@@ -65,7 +65,7 @@ class UploadFileInitializationTestCase: BaseTestCase {
 class UploadDataInitializationTestCase: BaseTestCase {
     func testUploadClassMethodWithMethodURLAndData() {
         // Given
-        let URLString = "http://httpbin.org/"
+        let URLString = "https://httpbin.org/"
 
         // When
         let request = Alamofire.upload(.POST, URLString, data: NSData())
@@ -79,7 +79,7 @@ class UploadDataInitializationTestCase: BaseTestCase {
 
     func testUploadClassMethodWithMethodURLHeadersAndData() {
         // Given
-        let URLString = "http://httpbin.org/"
+        let URLString = "https://httpbin.org/"
 
         // When
         let request = Alamofire.upload(.POST, URLString, headers: ["Authorization": "123456"], data: NSData())
@@ -101,7 +101,7 @@ class UploadDataInitializationTestCase: BaseTestCase {
 class UploadStreamInitializationTestCase: BaseTestCase {
     func testUploadClassMethodWithMethodURLAndStream() {
         // Given
-        let URLString = "http://httpbin.org/"
+        let URLString = "https://httpbin.org/"
         let imageURL = URLForResource("rainbow", withExtension: "jpg")
         let imageStream = NSInputStream(URL: imageURL)!
 
@@ -117,7 +117,7 @@ class UploadStreamInitializationTestCase: BaseTestCase {
 
     func testUploadClassMethodWithMethodURLHeadersAndStream() {
         // Given
-        let URLString = "http://httpbin.org/"
+        let URLString = "https://httpbin.org/"
         let imageURL = URLForResource("rainbow", withExtension: "jpg")
         let imageStream = NSInputStream(URL: imageURL)!
 
@@ -141,7 +141,7 @@ class UploadStreamInitializationTestCase: BaseTestCase {
 class UploadDataTestCase: BaseTestCase {
     func testUploadDataRequest() {
         // Given
-        let URLString = "http://httpbin.org/post"
+        let URLString = "https://httpbin.org/post"
         let data = "Lorem ipsum dolor sit amet".dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)!
 
         let expectation = expectationWithDescription("Upload request should succeed: \(URLString)")
@@ -170,7 +170,7 @@ class UploadDataTestCase: BaseTestCase {
 
     func testUploadDataRequestWithProgress() {
         // Given
-        let URLString = "http://httpbin.org/post"
+        let URLString = "https://httpbin.org/post"
         let data: NSData = {
             var text = ""
             for _ in 1...3_000 {
@@ -251,7 +251,7 @@ class UploadMultipartFormDataTestCase: BaseTestCase {
 
     func testThatUploadingMultipartFormDataSetsContentTypeHeader() {
         // Given
-        let URLString = "http://httpbin.org/post"
+        let URLString = "https://httpbin.org/post"
         let uploadData = "upload_data".dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)!
 
         let expectation = expectationWithDescription("multipart form data upload should succeed")
@@ -308,7 +308,7 @@ class UploadMultipartFormDataTestCase: BaseTestCase {
 
     func testThatUploadingMultipartFormDataSucceedsWithDefaultParameters() {
         // Given
-        let URLString = "http://httpbin.org/post"
+        let URLString = "https://httpbin.org/post"
         let french = "français".dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)!
         let japanese = "日本語".dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)!
 
@@ -363,7 +363,7 @@ class UploadMultipartFormDataTestCase: BaseTestCase {
 
     func testThatUploadingMultipartFormDataBelowMemoryThresholdStreamsFromMemory() {
         // Given
-        let URLString = "http://httpbin.org/post"
+        let URLString = "https://httpbin.org/post"
         let french = "français".dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)!
         let japanese = "日本語".dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)!
 
@@ -408,7 +408,7 @@ class UploadMultipartFormDataTestCase: BaseTestCase {
 
     func testThatUploadingMultipartFormDataBelowMemoryThresholdSetsContentTypeHeader() {
         // Given
-        let URLString = "http://httpbin.org/post"
+        let URLString = "https://httpbin.org/post"
         let uploadData = "upload data".dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)!
 
         let expectation = expectationWithDescription("multipart form data upload should succeed")
@@ -462,7 +462,7 @@ class UploadMultipartFormDataTestCase: BaseTestCase {
 
     func testThatUploadingMultipartFormDataAboveMemoryThresholdStreamsFromDisk() {
         // Given
-        let URLString = "http://httpbin.org/post"
+        let URLString = "https://httpbin.org/post"
         let french = "français".dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)!
         let japanese = "日本語".dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)!
 
@@ -512,7 +512,7 @@ class UploadMultipartFormDataTestCase: BaseTestCase {
 
     func testThatUploadingMultipartFormDataAboveMemoryThresholdSetsContentTypeHeader() {
         // Given
-        let URLString = "http://httpbin.org/post"
+        let URLString = "https://httpbin.org/post"
         let uploadData = "upload data".dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)!
 
         let expectation = expectationWithDescription("multipart form data upload should succeed")
@@ -569,7 +569,7 @@ class UploadMultipartFormDataTestCase: BaseTestCase {
 
     private func executeMultipartFormDataUploadRequestWithProgress(streamFromDisk streamFromDisk: Bool) {
         // Given
-        let URLString = "http://httpbin.org/post"
+        let URLString = "https://httpbin.org/post"
         let loremData1: NSData = {
             var loremValues: [String] = []
             for _ in 1...1_500 {

+ 14 - 14
Tests/ValidationTests.swift

@@ -27,7 +27,7 @@ import XCTest
 class StatusCodeValidationTestCase: BaseTestCase {
     func testThatValidationForRequestWithAcceptableStatusCodeResponseSucceeds() {
         // Given
-        let URLString = "http://httpbin.org/status/200"
+        let URLString = "https://httpbin.org/status/200"
         let expectation = expectationWithDescription("request should return 200 status code")
 
         var error: NSError?
@@ -48,7 +48,7 @@ class StatusCodeValidationTestCase: BaseTestCase {
 
     func testThatValidationForRequestWithUnacceptableStatusCodeResponseFails() {
         // Given
-        let URLString = "http://httpbin.org/status/404"
+        let URLString = "https://httpbin.org/status/404"
         let expectation = expectationWithDescription("request should return 404 status code")
 
         var error: NSError?
@@ -70,7 +70,7 @@ class StatusCodeValidationTestCase: BaseTestCase {
 
     func testThatValidationForRequestWithNoAcceptableStatusCodesFails() {
         // Given
-        let URLString = "http://httpbin.org/status/201"
+        let URLString = "https://httpbin.org/status/201"
         let expectation = expectationWithDescription("request should return 201 status code")
 
         var error: NSError?
@@ -96,7 +96,7 @@ class StatusCodeValidationTestCase: BaseTestCase {
 class ContentTypeValidationTestCase: BaseTestCase {
     func testThatValidationForRequestWithAcceptableContentTypeResponseSucceeds() {
         // Given
-        let URLString = "http://httpbin.org/ip"
+        let URLString = "https://httpbin.org/ip"
         let expectation = expectationWithDescription("request should succeed and return ip")
 
         var error: NSError?
@@ -117,7 +117,7 @@ class ContentTypeValidationTestCase: BaseTestCase {
 
     func testThatValidationForRequestWithAcceptableWildcardContentTypeResponseSucceeds() {
         // Given
-        let URLString = "http://httpbin.org/ip"
+        let URLString = "https://httpbin.org/ip"
         let expectation = expectationWithDescription("request should succeed and return ip")
 
         var error: NSError?
@@ -140,7 +140,7 @@ class ContentTypeValidationTestCase: BaseTestCase {
 
     func testThatValidationForRequestWithUnacceptableContentTypeResponseFails() {
         // Given
-        let URLString = "http://httpbin.org/xml"
+        let URLString = "https://httpbin.org/xml"
         let expectation = expectationWithDescription("request should succeed and return xml")
 
         var error: NSError?
@@ -162,7 +162,7 @@ class ContentTypeValidationTestCase: BaseTestCase {
 
     func testThatValidationForRequestWithNoAcceptableContentTypeResponseFails() {
         // Given
-        let URLString = "http://httpbin.org/xml"
+        let URLString = "https://httpbin.org/xml"
         let expectation = expectationWithDescription("request should succeed and return xml")
 
         var error: NSError?
@@ -188,7 +188,7 @@ class ContentTypeValidationTestCase: BaseTestCase {
 class MultipleValidationTestCase: BaseTestCase {
     func testThatValidationForRequestWithAcceptableStatusCodeAndContentTypeResponseSucceeds() {
         // Given
-        let URLString = "http://httpbin.org/ip"
+        let URLString = "https://httpbin.org/ip"
         let expectation = expectationWithDescription("request should succeed and return ip")
 
         var error: NSError?
@@ -210,7 +210,7 @@ class MultipleValidationTestCase: BaseTestCase {
 
     func testThatValidationForRequestWithUnacceptableStatusCodeAndContentTypeResponseFails() {
         // Given
-        let URLString = "http://httpbin.org/xml"
+        let URLString = "https://httpbin.org/xml"
         let expectation = expectationWithDescription("request should succeed and return xml")
 
         var error: NSError?
@@ -237,7 +237,7 @@ class MultipleValidationTestCase: BaseTestCase {
 class AutomaticValidationTestCase: BaseTestCase {
     func testThatValidationForRequestWithAcceptableStatusCodeAndContentTypeResponseSucceeds() {
         // Given
-        let URL = NSURL(string: "http://httpbin.org/ip")!
+        let URL = NSURL(string: "https://httpbin.org/ip")!
         let mutableURLRequest = NSMutableURLRequest(URL: URL)
         mutableURLRequest.setValue("application/json", forHTTPHeaderField: "Accept")
 
@@ -261,7 +261,7 @@ class AutomaticValidationTestCase: BaseTestCase {
 
     func testThatValidationForRequestWithUnacceptableStatusCodeResponseFails() {
         // Given
-        let URLString = "http://httpbin.org/status/404"
+        let URLString = "https://httpbin.org/status/404"
         let expectation = expectationWithDescription("request should return 404 status code")
 
         var error: NSError?
@@ -283,7 +283,7 @@ class AutomaticValidationTestCase: BaseTestCase {
 
     func testThatValidationForRequestWithAcceptableWildcardContentTypeResponseSucceeds() {
         // Given
-        let URL = NSURL(string: "http://httpbin.org/ip")!
+        let URL = NSURL(string: "https://httpbin.org/ip")!
         let mutableURLRequest = NSMutableURLRequest(URL: URL)
         mutableURLRequest.setValue("application/*", forHTTPHeaderField: "Accept")
 
@@ -307,7 +307,7 @@ class AutomaticValidationTestCase: BaseTestCase {
 
     func testThatValidationForRequestWithAcceptableComplexContentTypeResponseSucceeds() {
         // Given
-        let URL = NSURL(string: "http://httpbin.org/xml")!
+        let URL = NSURL(string: "https://httpbin.org/xml")!
         let mutableURLRequest = NSMutableURLRequest(URL: URL)
 
         let headerValue = "text/xml, application/xml, application/xhtml+xml, text/html;q=0.9, text/plain;q=0.8,*/*;q=0.5"
@@ -333,7 +333,7 @@ class AutomaticValidationTestCase: BaseTestCase {
 
     func testThatValidationForRequestWithUnacceptableContentTypeResponseFails() {
         // Given
-        let URL = NSURL(string: "http://httpbin.org/xml")!
+        let URL = NSURL(string: "https://httpbin.org/xml")!
         let mutableURLRequest = NSMutableURLRequest(URL: URL)
         mutableURLRequest.setValue("application/json", forHTTPHeaderField: "Accept")