mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 17:10:48 +00:00
minor safety tweak
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@29896 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
c8c728eb80
commit
5af99e8da5
1 changed files with 9 additions and 2 deletions
|
@ -1304,11 +1304,18 @@ static NSURLProtocol *placeholder = nil;
|
|||
[m appendString: [d objectForKey: s]];
|
||||
[m appendString: @"\r\n"];
|
||||
}
|
||||
/* Use valueForHTTPHeaderField: to check for content-type
|
||||
* header as that does a case insensitive comparison and
|
||||
* we therefore won't end up adding a second header by
|
||||
* accident because the two header names differ in case.
|
||||
*/
|
||||
if ([[this->request HTTPMethod] isEqual: @"POST"]
|
||||
&& [d objectForKey: @"Content-Type"] == nil)
|
||||
&& [this->request valueForHTTPHeaderField:
|
||||
@"Content-Type"] == nil)
|
||||
{
|
||||
/* On MacOSX, this is automatically added to POST methods */
|
||||
[m appendString: @"Content-Type: application/x-www-form-urlencoded\r\n"];
|
||||
[m appendString:
|
||||
@"Content-Type: application/x-www-form-urlencoded\r\n"];
|
||||
}
|
||||
if ([this->request valueForHTTPHeaderField: @"Host"] == nil)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue