]> gitweb.factorcode.org Git - factor.git/blob - basis/furnace/redirection/redirection-docs.factor
Merge branch 'master' into experimental
[factor.git] / basis / furnace / redirection / redirection-docs.factor
1 USING: help.markup help.syntax io.streams.string quotations urls
2 http.server http ;
3 IN: furnace.redirection
4
5 HELP: <redirect-responder>
6 { $values { "url" url } { "responder" "a responder" } }
7 { $description "Creates a responder which unconditionally redirects the client to the given URL." } ;
8
9 HELP: <redirect>
10 { $values { "url" url } { "response" response } }
11 { $description "Creates a response which redirects the client to the given URL." } ;
12
13 HELP: <secure-only>
14 { $values { "responder" "a responder" } { "secure-only" "a responder" } }
15 { $description "Creates a new responder which ensures that the client is connecting via HTTPS before delegating to the underlying responder. If the client is connecting via HTTP, a redirect is sent instead." } ;
16
17 HELP: <secure-redirect>
18 { $values
19      { "url" url }
20      { "response" response }
21 }
22 { $description "Creates a responder which unconditionally redirects the client to the given URL after setting its protocol to HTTPS." }
23 { $notes "This word is intended to be used with a relative URL. The client is redirected to the relative URL, but with HTTPS instead of HTTP." } ;
24
25 HELP: >secure-url
26 { $values
27      { "url" url }
28      { "url'" url }
29 }
30 { $description "Sets the protocol of a URL to HTTPS." } ;
31
32 HELP: if-secure
33 { $values
34      { "quot" quotation }
35      { "response" response }
36 }
37 { $description "Runs a quotation if the current request was made over HTTPS, otherwise returns a redirect to have the client request the current page again via HTTPS." } ;
38
39 ARTICLE: "furnace.redirection.secure" "Secure redirection"
40 "The words in this section help with implementing sites which require SSL/TLS for additional security."
41 $nl
42 "Converting a HTTP URL into an HTTPS URL:"
43 { $subsection >secure-url }
44 "Redirecting the client to an HTTPS URL:"
45 { $subsection <secure-redirect> }
46 "Tools for writing responders which require SSL/TLS connections:"
47 { $subsection if-secure }
48 { $subsection <secure-only> } ;
49
50 ARTICLE: "furnace.redirection" "Furnace redirection support"
51 "The " { $vocab-link "furnace.redirection" } " vocabulary builds additional functionality on top of " { $vocab-link "http.server.redirection" } ", and integrates with various Furnace features such as " { $link "furnace.asides" } " and " { $link "furnace.conversations" } "."
52 $nl
53 "A redirection response which takes asides and conversations into account:"
54 { $subsection <redirect> }
55 "A responder which unconditionally redirects the client to another URL:"
56 { $subsection <redirect-responder> }
57 { $subsection "furnace.redirection.secure" } ;
58
59 ABOUT: "furnace.redirection"