mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 00:11:26 +00:00
Add default Content-Type to POST methods if none is present.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@29895 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
0ec0645f11
commit
c8c728eb80
2 changed files with 11 additions and 0 deletions
|
@ -1,3 +1,8 @@
|
|||
2010-03-10 Adam Fedor <fedor@mallory>
|
||||
|
||||
* Source/NSURLProtocol.m ([_NSHTTPURLProtocol -stream:stream:event]):
|
||||
Add default Content-Type to POST methods if none is present.
|
||||
|
||||
2010-03-09 Adam Fedor <fedor@gnu.org>
|
||||
|
||||
* Source/NSHTTPCookie.m: Finish off implementation
|
||||
|
|
|
@ -1304,6 +1304,12 @@ static NSURLProtocol *placeholder = nil;
|
|||
[m appendString: [d objectForKey: s]];
|
||||
[m appendString: @"\r\n"];
|
||||
}
|
||||
if ([[this->request HTTPMethod] isEqual: @"POST"]
|
||||
&& [d objectForKey: @"Content-Type"] == nil)
|
||||
{
|
||||
/* On MacOSX, this is automatically added to POST methods */
|
||||
[m appendString: @"Content-Type: application/x-www-form-urlencoded\r\n"];
|
||||
}
|
||||
if ([this->request valueForHTTPHeaderField: @"Host"] == nil)
|
||||
{
|
||||
id p = [u port];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue