health/provider.vim: check curl HTTPS support

closes #9925
closes #9928
This commit is contained in:
erw7 2019-04-20 18:32:14 +09:00 committed by Justin M. Keyes
parent 43356a43d0
commit d0fd66ba82

View File

@ -106,7 +106,8 @@ endfunction
" Fetch the contents of a URL.
function! s:download(url) abort
if executable('curl')
let has_curl = executable('curl')
if has_curl && system(['curl', '-V']) =~# 'Protocols:.*https'
let rv = s:system(['curl', '-sL', a:url], '', 1, 1)
return s:shell_error ? 'curl error with '.a:url.': '.s:shell_error : rv
elseif executable('python')
@ -124,7 +125,9 @@ function! s:download(url) abort
\ ? 'python urllib.request error: '.s:shell_error
\ : rv
endif
return 'missing `curl` and `python`, cannot make pypi request'
return 'missing `curl` '
\ .(has_curl ? '(with HTTPS support) ' : '')
\ .'and `python`, cannot make web request'
endfunction
" Check for clipboard tools.