[webrtc-pc] Lack of validation in RTCIceCandidate constructor

soareschen has just created a new issue for https://github.com/w3c/webrtc-pc:

== Lack of validation in RTCIceCandidate constructor ==
There is no validation requirement for the arguments inside `RTCIceCandidate` constructor other than that `sdpMid` and `sdpMLineIndex` must not be both `null`. This seems to imply that the values in `RTCIceCandidateInit` can be anything as long as they are of valid type.

I suspect that the rationale for this is that the actual validation is only done when the candidate is passed to `addIceCandidate`. If so it is helpful to put a note in the `RTCIceCandidate` constructor section.

I also have difficulty understanding the use of the other fields in `RTCIceCandidate` that are not in `RTCIceCandidateInit`. Since these fields are read only there doesn't seem to have way to set their values at all. There is also no place in the spec where these fields are being read, including `addIceCandidate`.

Please view or discuss this issue at https://github.com/w3c/webrtc-pc/issues/1165 using your GitHub account

Received on Friday, 5 May 2017 09:40:53 UTC