Index: src/OFHTTPRequest.m ================================================================== --- src/OFHTTPRequest.m +++ src/OFHTTPRequest.m @@ -75,14 +75,14 @@ - init { self = [super init]; requestType = OF_HTTP_REQUEST_TYPE_GET; - headers = [[OFDictionary alloc] - initWithObject: @"Something using ObjFW " - @"" - forKey: @"User-Agent"]; + headers = [[OFDictionary alloc] initWithKeysAndObjects: + @"Connection", @"close", + @"User-Agent", @"Something using ObjFW " + @"", nil]; storesData = YES; return self; } Index: tests/OFHTTPRequestTests.m ================================================================== --- tests/OFHTTPRequestTests.m +++ tests/OFHTTPRequestTests.m @@ -63,10 +63,13 @@ assert(0); if (![[client readLine] isEqual: [OFString stringWithFormat: @"Host: 127.0.0.1:%" @PRIu16, port]]) assert(0); + + if (![[client readLine] isEqual: @"Connection: close"]) + assert(0); if (![[client readLine] hasPrefix: @"User-Agent:"]) assert(0); if (![[client readLine] isEqual: @""])