Selaa lähdekoodia

Merge branch 'master' into tvOS

Christian Noon 10 vuotta sitten
vanhempi
commit
3fa9f196c6
5 muutettua tiedostoa jossa 18 lisäystä ja 4 poistoa
  1. 1 1
      Alamofire.podspec
  2. 13 1
      CHANGELOG.md
  3. 1 1
      Source/Info.plist
  4. 1 1
      Source/Validation.swift
  5. 2 0
      Tests/ValidationTests.swift

+ 1 - 1
Alamofire.podspec

@@ -1,6 +1,6 @@
 Pod::Spec.new do |s|
   s.name = 'Alamofire'
-  s.version = '3.0.0'
+  s.version = '3.0.1'
   s.license = 'MIT'
   s.summary = 'Elegant HTTP Networking in Swift'
   s.homepage = 'https://github.com/Alamofire/Alamofire'

+ 13 - 1
CHANGELOG.md

@@ -3,7 +3,7 @@ All notable changes to this project will be documented in this file.
 `Alamofire` adheres to [Semantic Versioning](http://semver.org/).
 
 #### 3.x Releases
-- `3.0.x` Releases - [3.0.0](#300)
+- `3.0.x` Releases - [3.0.0](#300) | [3.0.1](#301)
 - `3.0.0` Betas - [3.0.0-beta.1](#300-beta1) | [3.0.0-beta.2](#300-beta2) | [3.0.0-beta.3](#300-beta3)
 
 #### 2.x Releases
@@ -18,6 +18,18 @@ All notable changes to this project will be documented in this file.
 
 ---
 
+## [3.0.1](https://github.com/Alamofire/Alamofire/releases/tag/3.0.1)
+Released on 2015-10-19. All issues associated with this milestone can be found using this
+[filter](https://github.com/Alamofire/Alamofire/issues?utf8=✓&q=milestone%3A3.0.1).
+
+#### Added
+- Tests around content type validation with accept parameters.
+  - Added by [Christian Noon](https://github.com/cnoon).
+
+#### Fixed
+- Content type validation issue where parameter parsing on `;` was incorrect.
+  - Fixed by [Christian Noon](https://github.com/cnoon).
+
 ## [3.0.0](https://github.com/Alamofire/Alamofire/releases/tag/3.0.0)
 Released on 2015-10-10. All issues associated with this milestone can be found using this
 [filter](https://github.com/Alamofire/Alamofire/issues?utf8=✓&q=milestone%3A3.0.0).

+ 1 - 1
Source/Info.plist

@@ -15,7 +15,7 @@
 	<key>CFBundlePackageType</key>
 	<string>FMWK</string>
 	<key>CFBundleShortVersionString</key>
-	<string>3.0.0</string>
+	<string>3.0.1</string>
 	<key>CFBundleSignature</key>
 	<string>????</string>
 	<key>CFBundleVersion</key>

+ 1 - 1
Source/Validation.swift

@@ -94,7 +94,7 @@ extension Request {
         init?(_ string: String) {
             let components: [String] = {
                 let stripped = string.stringByTrimmingCharactersInSet(NSCharacterSet.whitespaceAndNewlineCharacterSet())
-                let split = stripped.substringToIndex(stripped.rangeOfString(";")?.endIndex ?? stripped.endIndex)
+                let split = stripped.substringToIndex(stripped.rangeOfString(";")?.startIndex ?? stripped.endIndex)
                 return split.componentsSeparatedByString("/")
             }()
 

+ 2 - 0
Tests/ValidationTests.swift

@@ -116,6 +116,8 @@ class ContentTypeValidationTestCase: BaseTestCase {
         // When
         Alamofire.request(.GET, URLString)
             .validate(contentType: ["application/json"])
+            .validate(contentType: ["application/json;charset=utf8"])
+            .validate(contentType: ["application/json;q=0.8;charset=utf8"])
             .response { _, _, _, responseError in
                 error = responseError
                 expectation.fulfill()