linkcheck: Fix a protocol relative URL is considered as a local file

Since #7985, a protocol relative URL (URL starts with "//") is considered
as a local file incorrectly.  This makes it to a "unchecked" URL.

refs: #7985
This commit is contained in:
Takeshi KOMIYA
2020-07-24 02:12:47 +09:00
parent 3d0818f1cb
commit 875346307f

View File

@@ -35,7 +35,7 @@ from sphinx.util.requests import is_ssl_error
logger = logging.getLogger(__name__)
uri_re = re.compile('[a-z]+://')
uri_re = re.compile('([a-z]+:)?//') # matches to foo:// and // (a protocol relative URL)
DEFAULT_REQUEST_HEADERS = {