Skip to content

Commit 44ffec1

Browse files
committed
Fixed static analyzer issues
1 parent 257ed94 commit 44ffec1

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

GCDWebServer/Core/GCDWebServerConnection.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -753,7 +753,7 @@ - (GCDWebServerResponse*)preflightRequest:(GCDWebServerRequest*)request {
753753
NSString* authorizationHeader = [request.headers objectForKey:@"Authorization"];
754754
if ([authorizationHeader hasPrefix:@"Digest "]) {
755755
NSString* realm = GCDWebServerExtractHeaderValueParameter(authorizationHeader, @"realm");
756-
if ([realm isEqualToString:_server.authenticationRealm]) {
756+
if (realm && [_server.authenticationRealm isEqualToString:realm]) {
757757
NSString* nonce = GCDWebServerExtractHeaderValueParameter(authorizationHeader, @"nonce");
758758
if ([nonce isEqualToString:_digestAuthenticationNonce]) {
759759
NSString* username = GCDWebServerExtractHeaderValueParameter(authorizationHeader, @"username");

GCDWebServer/Core/GCDWebServerPrivate.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -207,10 +207,10 @@ extern NSString* GCDWebServerStringFromSockAddr(const struct sockaddr* addr, BOO
207207

208208
@interface GCDWebServer ()
209209
@property(nonatomic, readonly) NSMutableArray* handlers;
210-
@property(nonatomic, readonly) NSString* serverName;
211-
@property(nonatomic, readonly) NSString* authenticationRealm;
212-
@property(nonatomic, readonly) NSMutableDictionary* authenticationBasicAccounts;
213-
@property(nonatomic, readonly) NSMutableDictionary* authenticationDigestAccounts;
210+
@property(nonatomic, readonly, nullable) NSString* serverName;
211+
@property(nonatomic, readonly, nullable) NSString* authenticationRealm;
212+
@property(nonatomic, readonly, nullable) NSMutableDictionary* authenticationBasicAccounts;
213+
@property(nonatomic, readonly, nullable) NSMutableDictionary* authenticationDigestAccounts;
214214
@property(nonatomic, readonly) BOOL shouldAutomaticallyMapHEADToGET;
215215
@property(nonatomic, readonly) dispatch_queue_priority_t dispatchQueuePriority;
216216
- (void)willStartConnection:(GCDWebServerConnection*)connection;

0 commit comments

Comments
 (0)