提交 3382b461 编写于 作者: M Mattt Thompson

Merge pull request #254 from mowens/bug/handle-0-bytes

Added hanlding of valid NSData object with 0 bytes for serializers
......@@ -1366,7 +1366,7 @@ extension Request {
*/
public class func JSONResponseSerializer(options: NSJSONReadingOptions = .AllowFragments) -> Serializer {
return { (request, response, data) in
if data == nil {
if data == nil || data?.length == 0 {
return (nil, nil)
}
......@@ -1415,7 +1415,7 @@ extension Request {
*/
public class func propertyListResponseSerializer(options: NSPropertyListReadOptions = 0) -> Serializer {
return { (request, response, data) in
if data == nil {
if data == nil || data?.length == 0 {
return (nil, nil)
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册