diff --git a/Source/santasyncservice/SNTSyncStage.mm b/Source/santasyncservice/SNTSyncStage.mm index ad81998bb..40eb9a747 100644 --- a/Source/santasyncservice/SNTSyncStage.mm +++ b/Source/santasyncservice/SNTSyncStage.mm @@ -214,6 +214,17 @@ - (NSError *)performRequest:(NSURLRequest *)request NSData *data = [self dataFromRequest:request timeout:timeout]; if (data.length == 0) return nil; + if ([[SNTConfigurator configurator] syncEnableProtoTransfer]) { + if (!message->ParseFromString(std::string((const char *)data.bytes, data.length))) { + NSString *errStr = @"Failed to parse response proto into message"; + SLOGE(@"%@", errStr); + return [NSError errorWithDomain:@"com.google.santa.syncservice" + code:4 + userInfo:@{NSLocalizedDescriptionKey : errStr}]; + } + return nil; + } + google::protobuf::json::ParseOptions options{ .ignore_unknown_fields = true, };