Created
May 11, 2016 13:26
-
-
Save mattn/672e97387f2628902e73156ce91c1152 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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