From 95c2e855dd2b0aedcbbc250c89023594c4497b4c Mon Sep 17 00:00:00 2001 From: James Magahern Date: Fri, 9 May 2025 22:25:57 -0700 Subject: [PATCH] some better logging around websocket connections --- kordophone/Bridge/MBIMHTTPConnection.m | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/kordophone/Bridge/MBIMHTTPConnection.m b/kordophone/Bridge/MBIMHTTPConnection.m index e81e45f..c7fc2d0 100644 --- a/kordophone/Bridge/MBIMHTTPConnection.m +++ b/kordophone/Bridge/MBIMHTTPConnection.m @@ -132,13 +132,17 @@ NSURL *url = [NSURL URLWithString:path]; NSString *endpointName = [url lastPathComponent]; NSString *authTokenString = [url valueForQueryItemWithName:@"token"]; - MBIMAuthToken *authToken = [[MBIMAuthToken alloc] initWithTokenString:authTokenString]; + MBIMAuthToken *queryAuthToken = [[MBIMAuthToken alloc] initWithTokenString:authTokenString]; + NSLog(@"Websocket for URI: %@ | authenticated request: %@", path, [self isAuthenticated] ? @"YES" : @"NO"); if ([endpointName isEqualToString:@"updates"]) { - if (![authToken isValid]) { + if (![self isAuthenticated] && ![queryAuthToken isValid]) { + NSLog(@"Websocket: auth invalid, rejecting."); + NSLog(@"Query Token: %@, raw: %@", queryAuthToken, authTokenString); return nil; } + NSLog(@"Vending websocket for consumer"); return [[MBIMUpdateQueue sharedInstance] vendUpdateWebSocketConsumerForRequest:request socket:asyncSocket]; }