From 0555425861bdd754889bf00a31895e35b69bef6b Mon Sep 17 00:00:00 2001 From: John Benediktsson Date: Mon, 15 Jul 2013 09:30:22 -0700 Subject: [PATCH] http.client: default to http:// if not specified. --- basis/http/client/client.factor | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/basis/http/client/client.factor b/basis/http/client/client.factor index 7f99c62984..0f9cbc448c 100644 --- a/basis/http/client/client.factor +++ b/basis/http/client/client.factor @@ -140,10 +140,15 @@ SYMBOL: redirects [ do-redirect ] [ nip ] if ] with-variable ; inline recursive +: request-url ( url -- url' ) + dup >url dup protocol>> [ nip ] [ + drop "http://" prepend >url + ] if ensure-port ; + : ( url method -- request ) swap >>method - swap >url ensure-port >>url ; inline + swap request-url >>url ; inline PRIVATE>