Improve IP_PATTERN in DirectRTCClient in Android AppRTC Demo
Earlier, strings like "aaaa" and "1111" would be interpreted as IP addresses, which is not optimal. This CL improves the IP_PATTERN and adds a test for it. Review-Url: https://codereview.webrtc.org/2009493002 Cr-Commit-Position: refs/heads/master@{#12887}
This commit is contained in:
@ -42,10 +42,10 @@ public class DirectRTCClient implements AppRTCClient, TCPChannelClient.TCPChanne
|
||||
// IPv6
|
||||
+ "\\[((([0-9a-fA-F]{1,4}:)*[0-9a-fA-F]{1,4})?::"
|
||||
+ "(([0-9a-fA-F]{1,4}:)*[0-9a-fA-F]{1,4})?)\\]|"
|
||||
+ "\\[(([0-9a-fA-F]{1,4}:)*[0-9a-fA-F]{1,4})\\]|"
|
||||
+ "\\[(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4})\\]|"
|
||||
// IPv6 without []
|
||||
+ "((([0-9a-fA-F]{1,4}:)*[0-9a-fA-F]{1,4})?::(([0-9a-fA-F]{1,4}:)*[0-9a-fA-F]{1,4})?)|"
|
||||
+ "(([0-9a-fA-F]{1,4}:)*[0-9a-fA-F]{1,4})|"
|
||||
+ "(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4})|"
|
||||
// Literals
|
||||
+ "localhost"
|
||||
+ ")"
|
||||
|
||||
Reference in New Issue
Block a user