mirror of
https://github.com/notwa/rc
synced 2025-02-05 07:43:22 -08:00
print a newline between HTTP headers and response
This commit is contained in:
parent
444227fa55
commit
41ce9f1663
1 changed files with 1 additions and 1 deletions
2
sh/burl
2
sh/burl
|
@ -54,7 +54,7 @@ burl() ( ### @-
|
||||||
f() { request | "$@" | { receive && cat ;} ;}
|
f() { request | "$@" | { receive && cat ;} ;}
|
||||||
for url; do
|
for url; do
|
||||||
request() { printf 'GET /%s HTTP/1.0\r\nHost: %s\r\n\r\n' "${query#/}" "$dom" ;}
|
request() { printf 'GET /%s HTTP/1.0\r\nHost: %s\r\n\r\n' "${query#/}" "$dom" ;}
|
||||||
receive() { while IFS=$r read -r l _; [ "$l" ]; do printf >&2 %s\\n "$l"; done ;}
|
receive() { while IFS=$r read -r l _; [ "$l" ]; do printf %s\\n "$l"; done; echo ;} >&2
|
||||||
proto="${url%%:*}" proto="${proto##*[!a-z0-9-]*}"
|
proto="${url%%:*}" proto="${proto##*[!a-z0-9-]*}"
|
||||||
[ "$proto" ] && url="${url#$proto://}" || url="${url#//}"
|
[ "$proto" ] && url="${url#$proto://}" || url="${url#//}"
|
||||||
host="${url%%/*}" query="${url#"$host"}" dom="${host%:*}"
|
host="${url%%/*}" query="${url#"$host"}" dom="${host%:*}"
|
||||||
|
|
Loading…
Add table
Reference in a new issue