mirror of
https://github.com/pion/webrtc.git
synced 2025-09-27 03:25:58 +08:00
Don't use omitempty for ICECandidateInit
Always return sdpMid & sdpMLineindex value if it is null. The W3C starts every attribute definition with `If not null ...`
This commit is contained in:
@@ -16,12 +16,11 @@ func TestICECandidateInit_Serialization(t *testing.T) {
|
||||
Candidate: "candidate:abc123",
|
||||
SDPMid: refString("0"),
|
||||
SDPMLineIndex: refUint16(0),
|
||||
UsernameFragment: "def",
|
||||
UsernameFragment: refString("def"),
|
||||
}, `{"candidate":"candidate:abc123","sdpMid":"0","sdpMLineIndex":0,"usernameFragment":"def"}`},
|
||||
{ICECandidateInit{
|
||||
Candidate: "candidate:abc123",
|
||||
UsernameFragment: "def",
|
||||
}, `{"candidate":"candidate:abc123","usernameFragment":"def"}`},
|
||||
Candidate: "candidate:abc123",
|
||||
}, `{"candidate":"candidate:abc123","sdpMid":null,"sdpMLineIndex":null,"usernameFragment":null}`},
|
||||
}
|
||||
|
||||
for i, tc := range tt {
|
||||
|
Reference in New Issue
Block a user