Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(477)

Unified Diff: third_party/WebKit/Source/modules/peerconnection/RTCPeerConnection.cpp

Issue 2448843003: Throw SyntaxError for non-turn/turns/stun URLs (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/imported/wpt/webrtc/rtcpeerconnection/rtcpeerconnection-constructor-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 6864379a1a07ace4549517c0c16dcab00221a8cc..cec5ec646db74c233a3f9939e7f0c058b77d2a72 100644
--- a/third_party/WebKit/Source/modules/peerconnection/RTCPeerConnection.cpp
+++ b/third_party/WebKit/Source/modules/peerconnection/RTCPeerConnection.cpp
@@ -309,7 +309,10 @@ WebRTCConfiguration parseConfiguration(ExecutionContext* context,
if (!url.isValid() ||
hta - Chromium 2016/10/25 13:51:01 Having to call back my LGTM: You have to throw a d
foolip 2016/10/27 13:32:41 exceptionState.throwDOMException(SyntaxError, "'"
hta - Chromium 2016/11/08 12:12:30 :-) on the error generating problem - typical "syn
foolip 2016/11/08 15:39:07 Nope, that's still considered valid.
!(url.protocolIs("turn") || url.protocolIs("turns") ||
url.protocolIs("stun"))) {
- exceptionState.throwTypeError("Malformed URL");
+ exceptionState.throwDOMException(
+ SyntaxError,
+ "Unsupported URL \"" + urlString +
+ "\". URL scheme must be \"stun\", \"turn\" or \"turns\".");
hta - Chromium 2016/10/25 13:43:43 Hyper-nit: Should one use a StringBuilder instead
foolip 2016/10/27 13:32:41 Some places use String::format(), and a bunch use
return WebRTCConfiguration();
}
iceServers.append(WebRTCIceServer{url, username, credential});
« no previous file with comments | « third_party/WebKit/LayoutTests/imported/wpt/webrtc/rtcpeerconnection/rtcpeerconnection-constructor-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698