Chromium Code Reviews| Index: third_party/WebKit/Source/modules/peerconnection/RTCPeerConnection.cpp |
| diff --git a/third_party/WebKit/Source/modules/peerconnection/RTCPeerConnection.cpp b/third_party/WebKit/Source/modules/peerconnection/RTCPeerConnection.cpp |
| index 9e3ecb07b8b760b27ab25eb1813c7b6f7046b03d..0e627f0d90ee1c221789aed757dc78dab2b732ab 100644 |
| --- a/third_party/WebKit/Source/modules/peerconnection/RTCPeerConnection.cpp |
| +++ b/third_party/WebKit/Source/modules/peerconnection/RTCPeerConnection.cpp |
| @@ -306,10 +306,17 @@ WebRTCConfiguration parseConfiguration(ExecutionContext* context, |
| for (const String& urlString : urlStrings) { |
| KURL url(KURL(), urlString); |
| - if (!url.isValid() || |
| - !(url.protocolIs("turn") || url.protocolIs("turns") || |
| + if (!url.isValid()) { |
| + exceptionState.throwDOMException( |
| + SyntaxError, "'" + urlString + "' is not a valid URL."); |
| + return WebRTCConfiguration(); |
| + } |
| + if (!(url.protocolIs("turn") || url.protocolIs("turns") || |
| url.protocolIs("stun"))) { |
| - exceptionState.throwTypeError("Malformed URL"); |
| + exceptionState.throwDOMException( |
| + SyntaxError, "'" + url.protocol() + |
|
foolip
2016/10/27 13:34:38
This really isn't a SyntaxError, do we care? I don
hta - Chromium
2016/11/08 12:12:30
Neither do I :-) It's an illegal parameter, as lon
|
| + "' is not one of the supported URL schemes " |
| + "'stun', 'turn' or 'turns'."); |
| return WebRTCConfiguration(); |
| } |
| iceServers.append(WebRTCIceServer{url, username, credential}); |