db4
Slava Pestov 2008-05-14 06:08:57 -05:00
parent 8f96e40c1c
commit a190375c02
5 changed files with 7 additions and 4 deletions

View File

@ -1,6 +1,6 @@
! Copyright (C) 2008 Slava Pestov. ! Copyright (C) 2008 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: http.client checksums checksums.openssl splitting assocs USING: checksums checksums.openssl splitting assocs
kernel io.files bootstrap.image sequences io namespaces kernel io.files bootstrap.image sequences io namespaces
io.launcher math io.encodings.ascii ; io.launcher math io.encodings.ascii ;
IN: bootstrap.image.upload IN: bootstrap.image.upload

View File

@ -45,6 +45,7 @@ blah
[ [
TUPLE{ request TUPLE{ request
protocol: http
port: 80 port: 80
method: "GET" method: "GET"
path: "/bar" path: "/bar"
@ -84,6 +85,7 @@ Host: www.sex.com
[ [
TUPLE{ request TUPLE{ request
protocol: http
port: 80 port: 80
method: "HEAD" method: "HEAD"
path: "/bar" path: "/bar"

View File

@ -265,7 +265,7 @@ cookies ;
pick query>> set-at ; pick query>> set-at ;
: chop-hostname ( str -- str' ) : chop-hostname ( str -- str' )
":" split1 nip ":" split1 "//" ?head drop nip
CHAR: / over index over length or tail CHAR: / over index over length or tail
dup empty? [ drop "/" ] when ; dup empty? [ drop "/" ] when ;
@ -440,7 +440,7 @@ M: https protocol-addr
dup host>> [ dup host>> [
[ protocol>> protocol>string write "://" write ] [ protocol>> protocol>string write "://" write ]
[ host>> url-encode write ":" write ] [ host>> url-encode write ":" write ]
[ port>> number>string write ] [ [ port>> ] [ protocol>> http-port or ] bi number>string write ]
tri tri
] [ drop ] if ] [ drop ] if
] ]

View File

@ -6,6 +6,7 @@ IN: http.server.tests
[ [
<request> <request>
http >>protocol
"www.apple.com" >>host "www.apple.com" >>host
"/xxx/bar" >>path "/xxx/bar" >>path
{ { "a" "b" } } >>query { { "a" "b" } } >>query

View File

@ -6,6 +6,6 @@ IN: io.unix.files.unique
{ O_RDWR O_CREAT O_EXCL } flags ; { O_RDWR O_CREAT O_EXCL } flags ;
M: unix (make-unique-file) ( path -- ) M: unix (make-unique-file) ( path -- )
open-unique-flags file-mode open dup io-error close ; open-unique-flags file-mode open-file close-file ;
M: unix temporary-path ( -- path ) "/tmp" ; M: unix temporary-path ( -- path ) "/tmp" ;