relative-to-request ( url -- url' ) (original) (raw)

relative-to-request ( url -- url' )
Furnace framework » HTTP server » HTTP responder redirection

Prev: ( url -- response )

Vocabulary
http.server.redirection

Inputs

url a url or string

Outputs

url' a url or string

Word description
If the input is a relative url, makes it an absolute URL by resolving it to the current request's URL. If the input is a string, does nothing.

Definition

IN: http.server.redirection

GENERIC: relative-to-request ( url -- url' )

Methods

USING: http.server.redirection strings ;

M: string relative-to-request ;

USING: accessors http.server.redirection kernel namespaces urls
;

M: url relative-to-request
url get clone f >>query swap derive-url ensure-port ;