Index: src/OFHTTPRequest.m
==================================================================
--- src/OFHTTPRequest.m
+++ src/OFHTTPRequest.m
@@ -76,14 +76,14 @@
- init
{
self = [super init];
requestType = OF_HTTP_REQUEST_TYPE_GET;
- headers = [[OFDictionary alloc] initWithKeysAndObjects:
- @"Connection", @"close",
- @"User-Agent", @"Something using ObjFW "
- @"", nil];
+ headers = [[OFDictionary alloc]
+ initWithObject: @"Something using ObjFW "
+ @""
+ forKey: @"User-Agent"];
storesData = YES;
return self;
}
@@ -251,10 +251,12 @@
if ([URL port] == 80)
[sock writeFormat: @"Host: %@\r\n", [URL host]];
else
[sock writeFormat: @"Host: %@:%d\r\n", [URL host],
[URL port]];
+
+ [sock writeString: @"Connection: close\r\n"];
keyEnumerator = [headers keyEnumerator];
objectEnumerator = [headers objectEnumerator];
while ((key = [keyEnumerator nextObject]) != nil &&