mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 09:04:13 +00:00
Fix combining header values and warn about empty/bad header values
This commit is contained in:
parent
570aa0bf2a
commit
5f92c87d78
1 changed files with 12 additions and 4 deletions
|
@ -130,14 +130,22 @@ typedef struct {
|
|||
while ((h = [e nextObject]) != nil)
|
||||
{
|
||||
NSString *n = [h namePreservingCase: YES];
|
||||
NSString *o = [this->headers objectForKey: n];
|
||||
NSString *v = [h fullValue];
|
||||
|
||||
if (nil != o)
|
||||
if ([v isKindOfClass: [NSString class]] && [v length] > 0)
|
||||
{
|
||||
n = [NSString stringWithFormat: @"%@, %@", o, n];
|
||||
NSString *o = [this->headers objectForKey: n];
|
||||
|
||||
if (nil != o)
|
||||
{
|
||||
n = [NSString stringWithFormat: @"%@, %@", o, v];
|
||||
}
|
||||
[self _setValue: v forHTTPHeaderField: n];
|
||||
}
|
||||
else
|
||||
{
|
||||
NSLog(@"Ignored bad/empty header value for %@", h);
|
||||
}
|
||||
[self _setValue: v forHTTPHeaderField: n];
|
||||
}
|
||||
}
|
||||
[self _checkHeaders];
|
||||
|
|
Loading…
Reference in a new issue