mozilla / webrtc-sdp

Rust SDP parser for WebRTC
Mozilla Public License 2.0
155 stars 30 forks source link

rsdparsa splits on any arbitrary amount of any kind of whitespace #74

Closed Paul-E closed 7 years ago

Paul-E commented 7 years ago

rsdparsa splits on any arbitrary amount of any kind of whitespace, whereas the RFCs usually specify tokens are separted by SP, which is defined by the RBNF RFC(https://tools.ietf.org/html/rfc5234#appendix-B.1) as only 0x20. Do we want to be more strict in parsing SDP? I would guess being strict would break a lot of things if SIPCC already splits on any kind of whitespace pattern.

nils-ohlmeier commented 7 years ago

I think this is a classic case of: be liberal on what you receive, be strict on what you send.

So when we generate SDP should only use SP. But we make the live of everyone a lot easier when we are flexible on the amount and kind of withe spaces. Especially as it doesn't cost us any thing to do so, because we get the split method from Rust for free. I'm pretty sure the spec is only strict about it to make it easier for implementers.