处理上架的问题
1:处理了openurl 拉起问题 2:去掉了http 3 隐私等等
This commit is contained in:
@@ -225,7 +225,10 @@ static NSString * const kKBStreamSplitToken = @"<SPLIT>";
|
||||
}
|
||||
if (payload.length > 0) {
|
||||
if (self.loggingEnabled) {
|
||||
NSLog(@"[KBStream] SSE raw payload: %@", payload);
|
||||
#if DEBUG
|
||||
NSLog(@"[KBStream] SSE raw payload len=%lu",
|
||||
(unsigned long)(payload ?: @"").length);
|
||||
#endif
|
||||
}
|
||||
NSString *llmText = nil;
|
||||
if ([self processLLMChunkPayload:payload output:&llmText]) {
|
||||
@@ -278,7 +281,10 @@ static NSString * const kKBStreamSplitToken = @"<SPLIT>";
|
||||
}
|
||||
if (payload.length > 0) {
|
||||
if (self.loggingEnabled) {
|
||||
NSLog(@"[KBStream] SSE raw payload: %@", payload);
|
||||
#if DEBUG
|
||||
NSLog(@"[KBStream] SSE raw payload len=%lu",
|
||||
(unsigned long)(payload ?: @"").length);
|
||||
#endif
|
||||
}
|
||||
NSString *delta = nil;
|
||||
if ((NSInteger)payload.length >= self.deliveredCharCount) {
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
//
|
||||
|
||||
#import "NetworkStreamHandler.h"
|
||||
#import <Security/Security.h>
|
||||
|
||||
@interface NetworkStreamHandler ()
|
||||
|
||||
@@ -243,8 +244,26 @@ didReceiveChallenge:(NSURLAuthenticationChallenge *)challenge
|
||||
|
||||
// 处理 SSL 认证挑战
|
||||
if ([challenge.protectionSpace.authenticationMethod isEqualToString:NSURLAuthenticationMethodServerTrust]) {
|
||||
NSURLCredential *credential = [NSURLCredential credentialForTrust:challenge.protectionSpace.serverTrust];
|
||||
completionHandler(NSURLSessionAuthChallengeUseCredential, credential);
|
||||
SecTrustRef trust = challenge.protectionSpace.serverTrust;
|
||||
if (!trust) {
|
||||
completionHandler(NSURLSessionAuthChallengeCancelAuthenticationChallenge, nil);
|
||||
return;
|
||||
}
|
||||
BOOL ok = NO;
|
||||
if (@available(iOS 13.0, *)) {
|
||||
ok = SecTrustEvaluateWithError(trust, nil);
|
||||
} else {
|
||||
SecTrustResultType result = kSecTrustResultInvalid;
|
||||
OSStatus status = SecTrustEvaluate(trust, &result);
|
||||
ok = (status == errSecSuccess) &&
|
||||
(result == kSecTrustResultUnspecified || result == kSecTrustResultProceed);
|
||||
}
|
||||
if (ok) {
|
||||
NSURLCredential *credential = [NSURLCredential credentialForTrust:trust];
|
||||
completionHandler(NSURLSessionAuthChallengeUseCredential, credential);
|
||||
} else {
|
||||
completionHandler(NSURLSessionAuthChallengeCancelAuthenticationChallenge, nil);
|
||||
}
|
||||
} else {
|
||||
completionHandler(NSURLSessionAuthChallengePerformDefaultHandling, nil);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user