286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
|
requestType = OF_HTTP_REQUEST_TYPE_POST;
else if ([type isEqual: @"HEAD"])
requestType = OF_HTTP_REQUEST_TYPE_HEAD;
else
return [self sendErrorAndClose: 501];
@try {
path = [[line substringWithRange:
of_range(pos + 1, [line length] - pos - 10)] retain];
} @catch (OFOutOfRangeException *e) {
return [self sendErrorAndClose: 400];
}
if (![path hasPrefix: @"/"])
return [self sendErrorAndClose: 400];
headers = [[OFMutableDictionary alloc] init];
state = PARSING_HEADERS;
|
|
|
>
|
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
|
requestType = OF_HTTP_REQUEST_TYPE_POST;
else if ([type isEqual: @"HEAD"])
requestType = OF_HTTP_REQUEST_TYPE_HEAD;
else
return [self sendErrorAndClose: 501];
@try {
path = [line substringWithRange:
of_range(pos + 1, [line length] - pos - 10)];
} @catch (OFOutOfRangeException *e) {
return [self sendErrorAndClose: 400];
}
path = [[path stringByDeletingEnclosingWhitespaces] retain];
if (![path hasPrefix: @"/"])
return [self sendErrorAndClose: 400];
headers = [[OFMutableDictionary alloc] init];
state = PARSING_HEADERS;
|