Allow localhost HTTP URLs for the capport API

Allowing the capport API to be hosted on localhost makes it easy to
write fast, stable tests for the feature.
This was not possible because:
 - Pre-validation of the URL used Patterns.WEB_URL, which is
  over-restrictive and excludes domain names without TLD
 - NetworkMonitor needs the API to be hosted via HTTPS which is working
   as intended, however relaxing this requirement only for localhost
   (for testing) seems reasonable.

Bug: 156062304
Test: atest CaptivePortalApiTest in associated change
Original-Change: https://android-review.googlesource.com/1309235
Merged-In: I5f2cdd02376785b152e5b9a6e798d797894ea45b
Change-Id: I5f2cdd02376785b152e5b9a6e798d797894ea45b
3 files changed