Skip to content

Commit 000de97

Browse files
authored
Respect Redirects in Curl Requests(#485)
1 parent d152e6c commit 000de97

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

autoload/codeium/command.vim

+2-2
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ function! s:commands.Auth(...) abort
9191
endif
9292

9393
while empty(api_key) && tries < 3
94-
let command = 'curl -sS ' . register_user_url . ' ' .
94+
let command = 'curl -sSL ' . register_user_url . ' ' .
9595
\ '--header "Content-Type: application/json" ' .
9696
\ '--data ' . shellescape(json_encode({'firebase_id_token': auth_token}))
9797
let response = system(command)
@@ -104,7 +104,7 @@ function! s:commands.Auth(...) abort
104104
\ . 'Would you like to try auth without checking SSL certificate revocation? (y/n): ')
105105
call inputrestore()
106106
if useNoSsl ==? 'y'
107-
let command = 'curl --ssl-no-revoke -sS ' . register_user_url . ' ' .
107+
let command = 'curl --ssl-no-revoke -sSL ' . register_user_url . ' ' .
108108
\ '--header "Content-Type: application/json" ' .
109109
\ '--data ' . shellescape(json_encode({'firebase_id_token': auth_token}))
110110
let response = system(command)

autoload/codeium/server.vim

+2-2
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ function! codeium#server#Request(type, data, ...) abort
7373
\ '/exa.language_server_pb.LanguageServerService/' . a:type
7474
let data = json_encode(a:data)
7575
let args = [
76-
\ 'curl', uri,
76+
\ 'curl', '-L', uri,
7777
\ '--header', 'Content-Type: application/json',
7878
\ '-d@-'
7979
\ ]
@@ -188,7 +188,7 @@ function! codeium#server#Start(...) abort
188188

189189
let config = get(g:, 'codeium_server_config', {})
190190
if has_key(config, 'portal_url') && !empty(config.portal_url)
191-
let response = system('curl -s ' . config.portal_url . '/api/version')
191+
let response = system('curl -sL ' . config.portal_url . '/api/version')
192192
if v:shell_error == '0'
193193
let s:language_server_version = response
194194
let s:language_server_sha = 'enterprise-' . s:language_server_version

0 commit comments

Comments
 (0)