feat(go): persist full raw payload chunks
This commit is contained in:
@@ -122,9 +122,7 @@ func ParseFrame(raw []byte, receivedAtMS int64, sourceEndpoint string) (envelope
|
||||
"versioned": versioned,
|
||||
"properties": props,
|
||||
"body_size": bodySize,
|
||||
"phone_bcd_hex": strings.ToUpper(hex.EncodeToString(phoneBCD)),
|
||||
"phone": phone,
|
||||
"phone_raw": phoneRaw,
|
||||
"sequence": binary.BigEndian.Uint16(raw[serialStart : serialStart+2]),
|
||||
"subpackage": subpackage,
|
||||
"package_info": packageInfo,
|
||||
|
||||
@@ -118,8 +118,11 @@ func TestParseFrameSupportsJT8082019VersionedHeader(t *testing.T) {
|
||||
if header["versioned"] != true || header["protocol_version"] != byte(1) {
|
||||
t.Fatalf("unexpected versioned header: %#v", header)
|
||||
}
|
||||
if header["phone_bcd_hex"] != "00000000014894135060" {
|
||||
t.Fatalf("phone bcd = %#v", header["phone_bcd_hex"])
|
||||
if _, ok := header["phone_bcd_hex"]; ok {
|
||||
t.Fatalf("phone_bcd_hex should not be exposed: %#v", header)
|
||||
}
|
||||
if _, ok := header["phone_raw"]; ok {
|
||||
t.Fatalf("phone_raw should not be exposed: %#v", header)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user