350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
|
{
OFString *method;
OFMutableString *path;
size_t pos;
@try {
OFString *version = [line
substringWithRange: OFMakeRange(line.length - 9, 9)];
OFUnichar tmp;
if (![version hasPrefix: @" HTTP/1."])
return [self sendErrorAndClose: 505];
tmp = [version characterAtIndex: 8];
if (tmp < '0' || tmp > '9')
|
|
|
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
|
{
OFString *method;
OFMutableString *path;
size_t pos;
@try {
OFString *version = [line
substringWithRange: OFRangeMake(line.length - 9, 9)];
OFUnichar tmp;
if (![version hasPrefix: @" HTTP/1."])
return [self sendErrorAndClose: 505];
tmp = [version characterAtIndex: 8];
if (tmp < '0' || tmp > '9')
|
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
|
@try {
_method = of_http_request_method_from_string(method);
} @catch (OFInvalidArgumentException *e) {
return [self sendErrorAndClose: 405];
}
@try {
OFRange range = OFMakeRange(pos + 1, line.length - pos - 10);
path = [[[line substringWithRange:
range] mutableCopy] autorelease];
} @catch (OFOutOfRangeException *e) {
return [self sendErrorAndClose: 400];
}
|
|
|
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
|
@try {
_method = of_http_request_method_from_string(method);
} @catch (OFInvalidArgumentException *e) {
return [self sendErrorAndClose: 405];
}
@try {
OFRange range = OFRangeMake(pos + 1, line.length - pos - 10);
path = [[[line substringWithRange:
range] mutableCopy] autorelease];
} @catch (OFOutOfRangeException *e) {
return [self sendErrorAndClose: 400];
}
|