Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

* sh (bash, ksh, zsh) is in use, stderr is redirected to /dev/tty.

  • Loading branch information...
commit 6fea20775ffa38134d73f6c3d4bc7f118053289d 1 parent 6253ecd
py0n authored committed
Showing with 10 additions and 0 deletions.
  1. +10 −0 autoload/http.vim
View
10 autoload/http.vim
@@ -124,6 +124,10 @@ function! http#get(url, ...)
if strlen(getdatastr)
let url .= "?" . getdatastr
endif
+ let old_shellredir = &shellredir
+ if &shell =~ "\\(ba\\|k\\|z\\)\\?sh"
+ set shellredir =>%s\ 2>/dev/tty
+ endif
if executable('curl')
let command = 'curl -L -s -k -i '
let quote = &shellxquote == '"' ? "'" : '"'
@@ -149,6 +153,7 @@ function! http#get(url, ...)
let command .= " ".quote.url.quote
let res = system(command)
endif
+ let &shellredir = old_shellredir
if res =~ '^HTTP/1.\d 3' || res =~ '^HTTP/1\.\d 200 Connection established'
let pos = stridx(res, "\r\n\r\n")
if pos != -1
@@ -181,6 +186,10 @@ function! http#post(url, ...)
else
let postdatastr = postdata
endif
+ let old_shellredir = &shellredir
+ if &shell =~ "\\(ba\\|k\\|z\\)\\?sh"
+ set shellredir =>%s\ 2>/dev/tty
+ endif
if executable('curl')
let command = 'curl -L -s -k -i -X '.method
let quote = &shellxquote == '"' ? "'" : '"'
@@ -211,6 +220,7 @@ function! http#post(url, ...)
call writefile(split(postdatastr, "\n"), file, "b")
let res = system(command . " --post-data @" . quote.file.quote)
endif
+ let &shellredir = old_shellredir
call delete(file)
if res =~ '^HTTP/1.\d 3' || res =~ '^HTTP/1\.\d 200 Connection established'
let pos = stridx(res, "\r\n\r\n")

0 comments on commit 6fea207

Please sign in to comment.
Something went wrong with that request. Please try again.