Skip to content

Instantly share code, notes, and snippets.

@mattn
Created May 11, 2016 13:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattn/672e97387f2628902e73156ce91c1152 to your computer and use it in GitHub Desktop.
Save mattn/672e97387f2628902e73156ce91c1152 to your computer and use it in GitHub Desktop.
let res = join(readfile("t.txt", 1), "\n")
while res =~ '^HTTP/1.\d 3' || res =~ '^HTTP/1\.[01] [0-9]\{3} .\+\n\nHTTP/1\.[01] [0-9]\{3} .\+'
let pos = stridx(res, "\r\n\r\n")
if pos != -1
let res = strpart(res, pos+4)
else
let pos = stridx(res, "\n\n")
let res = strpart(res, pos+2)
endif
endwhile
echo res
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment