Added specs for zero-length Content-Length header when params is nil or empty

This commit is contained in:
Blake Watters
2011-07-20 21:55:10 -04:00
parent 67648a24a0
commit ae29401841
6 changed files with 88 additions and 8 deletions

View File

@@ -178,7 +178,9 @@
if ([_params respondsToSelector:@selector(HTTPHeaderValueForContentLength)]) {
[_URLRequest setValue:[NSString stringWithFormat:@"%d", [_params HTTPHeaderValueForContentLength]] forHTTPHeaderField:@"Content-Length"];
}
}
} else {
[_URLRequest setValue:@"0" forHTTPHeaderField:@"Content-Length"];
}
// Add authentication headers so we don't have to deal with an extra cycle for each message requiring basic auth.
if (self.forceBasicAuthentication) {