Skip to content

Commit

Permalink
Merge branch 'dev' into swift-openai
Browse files Browse the repository at this point in the history
  • Loading branch information
tisfeng committed Apr 1, 2024
2 parents 36ac7c2 + 1cb4073 commit 0c4a60c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Easydict/objc/Service/Baidu/EZBaiduTranslate.m
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@ - (AFHTTPSessionManager *)jsonSession {

- (NSString *)cookie {
NSString *cookie = [[NSUserDefaults standardUserDefaults] stringForKey:kBaiduTranslateURL] ?: @"BAIDUID=0F8E1A72A51EE47B7CA0A81711749C00:FG=1;";
if (![cookie containsString:@"smallFlowVersion=old"]) {
cookie = [NSString stringWithFormat:@"%@%@", cookie, @";smallFlowVersion=old;"];
}
return cookie;
}

Expand Down Expand Up @@ -766,6 +769,7 @@ - (void)sendGetTokenAndGtkRequestWithCompletion:(void (^)(NSString *_Nullable to
// set headers
for (NSString *key in headers.allKeys) {
[self.jsonSession.requestSerializer setValue:headers[key] forHTTPHeaderField:key];
[self.htmlSession.requestSerializer setValue:headers[key] forHTTPHeaderField:key];
}

[self.htmlSession GET:url parameters:nil progress:nil success:^(NSURLSessionDataTask *_Nonnull task, id _Nullable responseObject) {
Expand Down

0 comments on commit 0c4a60c

Please sign in to comment.