diff --git a/talk/app/webrtc/webrtcsdp.cc b/talk/app/webrtc/webrtcsdp.cc index b2d8a30ec5..412825e5cd 100644 --- a/talk/app/webrtc/webrtcsdp.cc +++ b/talk/app/webrtc/webrtcsdp.cc @@ -913,6 +913,12 @@ std::string SdpSerializeCandidate( std::vector candidates; candidates.push_back(candidate.candidate()); BuildCandidate(candidates, &message); + // From WebRTC draft section 4.8.1.1 candidate-attribute will be + // just candidate: not a=candidate:CRLF + ASSERT(message.find("a=") == 0); + message.erase(0, 2); + ASSERT(message.find(kLineBreak) == message.size() - 2); + message.resize(message.size() - 2); return message; } diff --git a/talk/app/webrtc/webrtcsdp_unittest.cc b/talk/app/webrtc/webrtcsdp_unittest.cc index 64776e29e1..e28599fc67 100644 --- a/talk/app/webrtc/webrtcsdp_unittest.cc +++ b/talk/app/webrtc/webrtcsdp_unittest.cc @@ -1575,7 +1575,7 @@ TEST_F(WebRtcSdpTest, SerializeSessionDescriptionWithBufferLatency) { TEST_F(WebRtcSdpTest, SerializeCandidates) { std::string message = webrtc::SdpSerializeCandidate(*jcandidate_); - EXPECT_EQ(std::string(kSdpOneCandidate), message); + EXPECT_EQ(std::string(kRawCandidate), message); } TEST_F(WebRtcSdpTest, DeserializeSessionDescription) {