Skip to content

Commit c2cec95

Browse files
committed
fix proxy url parsing
1 parent 9e869d2 commit c2cec95

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

autoload/copilot/agent.vim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ function! copilot#agent#EditorInfo() abort
453453
else
454454
let proxy = ''
455455
endif
456-
let match = matchlist(proxy, '\c^\%([^:]\+://\)\=\%(\([^/:#]\+@\)\)\=\%(\([^/:#]\+\)\|\[\([[:xdigit:]:]\+\)\]\)\%(:\(\d\+\)\)\=\%(/\|$\|?strict_\=ssl=\(.*\)\)')
456+
let match = matchlist(proxy, '\c^\%([^:]\+://\)\=\%(\([^/#]\+@\)\)\=\%(\([^/:#]\+\)\|\[\([[:xdigit:]:]\+\)\]\)\%(:\(\d\+\)\)\=\%(/\|$\|?strict_\=ssl=\(.*\)\)')
457457
if !empty(match)
458458
let info.networkProxy = {'host': match[2] . match[3], 'port': empty(match[4]) ? 80 : +match[4]}
459459
if match[5] =~? '^[0f]'
@@ -465,7 +465,7 @@ function! copilot#agent#EditorInfo() abort
465465
endif
466466
if !empty(match[1])
467467
let info.networkProxy.username = s:UrlDecode(matchstr(match[1], '^[^:]*'))
468-
let info.networkProxy.password = s:UrlDecode(matchstr(match[1], ':\zs.*'))
468+
let info.networkProxy.password = s:UrlDecode(matchstr(match[1], ':\zs.*[^@]'))
469469
endif
470470
endif
471471
return info

0 commit comments

Comments
 (0)