mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-16 07:36:10 -04:00
Fix a macOS bug with web request when decoding data
PiperOrigin-RevId: 532940555
This commit is contained in:
committed by
Copybara-Service
parent
1c9dd093f1
commit
17ba32c68b
@@ -233,8 +233,8 @@ absl::StatusOr<WebResponse> ImplementationPlatform::SendRequest(const WebRequest
|
||||
webResponse.headers.insert({[key UTF8String], [value UTF8String]});
|
||||
}
|
||||
if (blockData != nil) {
|
||||
webResponse.body = [[[NSString alloc] initWithData:blockData
|
||||
encoding:NSUTF8StringEncoding] UTF8String];
|
||||
// Body is not a UTF-8 encoded string and is just using `std::string` as a container for data.
|
||||
webResponse.body = std::string((char *)blockData.bytes, blockData.length);
|
||||
}
|
||||
return webResponse;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user