 : resolve-base-path ( string -- string' )
     "$" ?head [
         [
-            "/" split1 [ base-path [  "/" % % ] each "/" % ] dip %
+            "/" split1 [ base-path [ "/" % % ] each "/" % ] dip %
         ] "" make
     ] when ;
 

! Copyright (C) 2008, 2010 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: definitions namespaces make assocs sequences kernel classes splitting
words vocabs.loader accessors strings combinators arrays
continuations present fry urls http http.server xml.syntax xml.writer
http.server.redirection http.server.remapping io.pathnames ;
IN: furnace.utilities

: word>string ( word -- string )


: referrer ( -- referrer/f )
    #! Typo is intentional, it's in the HTTP spec!
    request get "referer" header
    dup [ >url ensure-port [ remap-port ] change-port ] when ;

: user-agent ( -- user-agent )
    request get "user-agent" header "" or ;

: same-host? ( url -- ? )
    dup [
