Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions sphinx/builders/linkcheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class _Status(StrEnum):
logger = logging.getLogger(__name__)

# matches to foo:// and // (a protocol relative URL)
uri_re = re.compile('([a-z]+:)?//')
uri_re = re.compile('([a-z]+:)?//', re.IGNORECASE)

DEFAULT_REQUEST_HEADERS = {
'Accept': 'text/html,application/xhtml+xml;q=0.9,*/*;q=0.8',
Expand Down Expand Up @@ -466,9 +466,9 @@ def _check(self, docname: str, uri: str, hyperlink: Hyperlink) -> _URIProperties
)
return _Status.IGNORED, info, 0

if len(uri) == 0 or uri.startswith(('#', 'mailto:', 'tel:')):
if len(uri) == 0 or uri.lower().startswith(('#', 'mailto:', 'tel:')):
return _Status.UNCHECKED, '', 0
if not uri.startswith(('http:', 'https:')):
if not uri.lower().startswith(('http:', 'https:')):
if uri_re.match(uri):
# Non-supported URI schemes (ex. ftp)
return _Status.UNCHECKED, '', 0
Expand Down
Loading