Commit 9ab3f874 authored by Sebastian Kügler's avatar Sebastian Kügler
Browse files

allow loading local pages from local IPs

Summary:
The URL validation regex excluded local IPs. This seems unnecessary
limiting, as it makes it very hard to reach perfectly valid local
webservers (often found it smart homes, for example).

This patch removes this restriction, allowing me to reach some lights,
my NAS and a bunch of other local servers from Angelfish.

Other webbrowsers do not restrict this, and it's unclear to me from
looking at the source why Angelfish should.

Test Plan: Surfed to my local webservers, they now work.

Reviewers: #plasma, schmeisser

Reviewed By: #plasma

Subscribers: bshah

Differential Revision: https://phabricator.kde.org/D26141
parent ee061339
......@@ -49,7 +49,6 @@
// first and last IP address of each class is considered invalid
// (since they are broadcast/network addresses)
//
// - Added exclusion of private, reserved and/or local networks ranges
// - Made starting path slash optional (http://example.com?foo=bar)
// - Allow a dot (.) at the end of hostnames (http://example.com.)
// - Allow an underscore (_) character in host/domain names
......@@ -77,11 +76,6 @@ var re_weburl = new RegExp(
// user:pass BasicAuth (optional)
"(?:\\S+(?::\\S*)?@)?" +
"(?:" +
// IP address exclusion
// private & local networks
"(?!(?:10|127)(?:\\.\\d{1,3}){3})" +
"(?!(?:169\\.254|192\\.168)(?:\\.\\d{1,3}){2})" +
"(?!172\\.(?:1[6-9]|2\\d|3[0-1])(?:\\.\\d{1,3}){2})" +
// IP address dotted notation octets
// excludes loopback network 0.0.0.0
// excludes reserved space >= 224.0.0.0
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment