Merge pull request #3037 from dreampiggy/bugfix_request_modifier_nil

Fix the issue that the NSURLRequest method should not be nil, which may cause Crash
This commit is contained in:
DreamPiggy 2020-06-12 11:29:32 +08:00 committed by GitHub
commit f8fa41218d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -53,7 +53,7 @@
}
- (instancetype)initWithMethod:(NSString *)method headers:(NSDictionary<NSString *,NSString *> *)headers body:(NSData *)body {
method = [method copy];
method = method ? [method copy] : @"GET";
headers = [headers copy];
body = [body copy];
return [self initWithBlock:^NSURLRequest * _Nullable(NSURLRequest * _Nonnull request) {