Differences From Artifact [392b01fde8]:
- File src/OFHTTPClient.m — part of check-in [374e1a1bfa] at 2021-01-02 22:04:26 on branch trunk — Update copyright (user: js, size: 30182) [annotate] [blame] [check-ins using] [more...]
To Artifact [4079ebb727]:
- File
src/OFHTTPClient.m
— part of check-in
[a0fd103a0b]
at
2021-03-07 02:36:04
on branch trunk
— Style change: Allow more than 1 argument per line
This is only migrating some places, others will be migrated as they are
touched. (user: js, size: 30144) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
150 151 152 153 154 155 156 | if ([headers objectForKey: @"Host"] == nil) { OFNumber *port = URL.port; if (port != nil) { OFString *host = [OFString stringWithFormat: @"%@:%@", URL.URLEncodedHost, port]; | | < < | | < | < | 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 | if ([headers objectForKey: @"Host"] == nil) { OFNumber *port = URL.port; if (port != nil) { OFString *host = [OFString stringWithFormat: @"%@:%@", URL.URLEncodedHost, port]; [headers setObject: host forKey: @"Host"]; } else [headers setObject: URL.URLEncodedHost forKey: @"Host"]; } if ((user.length > 0 || password.length > 0) && [headers objectForKey: @"Authorization"] == nil) { OFMutableData *authorizationData = [OFMutableData data]; OFString *authorization; [authorizationData addItems: user.UTF8String count: user.UTF8StringLength]; [authorizationData addItem: ":"]; [authorizationData addItems: password.UTF8String count: password.UTF8StringLength]; authorization = [OFString stringWithFormat: @"Basic %@", authorizationData.stringByBase64Encoding]; [headers setObject: authorization forKey: @"Authorization"]; } if ([headers objectForKey: @"User-Agent"] == nil) [headers setObject: @"Something using ObjFW " @"<https://objfw.nil.im/>" forKey: @"User-Agent"]; if (request.protocolVersion.major == 1 && request.protocolVersion.minor == 0 && [headers objectForKey: @"Connection"] == nil) [headers setObject: @"keep-alive" forKey: @"Connection"]; hasContentLength = ([headers objectForKey: @"Content-Length"] != nil); chunked = [[headers objectForKey: @"Transfer-Encoding"] isEqual: @"chunked"]; if ((hasContentLength || chunked) && [headers objectForKey: @"Content-Type"] == nil) |
︙ | ︙ | |||
532 533 534 535 536 537 538 | value = [OFString stringWithUTF8String: tmp]; old = [_serverHeaders objectForKey: key]; if (old != nil) value = [old stringByAppendingFormat: @",%@", value]; | | < | 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 | value = [OFString stringWithUTF8String: tmp]; old = [_serverHeaders objectForKey: key]; if (old != nil) value = [old stringByAppendingFormat: @",%@", value]; [_serverHeaders setObject: value forKey: key]; return true; } - (bool)stream: (OFStream *)sock didReadLine: (OFString *)line exception: (id)exception |
︙ | ︙ |