lgtm: fix Incomplete URL substring sanitization

pull/6289/head
Daniel Mensinger 5 years ago committed by Jussi Pakkanen
parent b5cec1c632
commit ef19e1ff2d
  1. 4
      mesonbuild/wrap/wrap.py

@ -16,6 +16,7 @@ from .. import mlog
import contextlib
import urllib.request
import urllib.error
import urllib.parse
import os
import hashlib
import shutil
@ -310,7 +311,8 @@ class Resolver:
blocksize = 10 * 1024
h = hashlib.sha256()
tmpfile = tempfile.NamedTemporaryFile(mode='wb', dir=self.cachedir, delete=False)
if url.startswith('https://wrapdb.mesonbuild.com'):
hostname = urllib.parse.urlparse(url).hostname
if hostname == 'wrapdb.mesonbuild.com' or hostname.endswith('.wrapdb.mesonbuild.com'):
resp = open_wrapdburl(url)
else:
try:

Loading…
Cancel
Save