]> gitweb.factorcode.org Git - factor.git/blob - basis/furnace/redirection/redirection-docs.factor
factor: trim more using lists.
[factor.git] / basis / furnace / redirection / redirection-docs.factor
1 USING: help.markup help.syntax http quotations urls ;
2 IN: furnace.redirection
3
4 HELP: <redirect-responder>
5 { $values { "url" url } { "responder" "a responder" } }
6 { $description "Creates a responder which unconditionally redirects the client to the given URL." } ;
7
8 HELP: <redirect>
9 { $values { "url" url } { "response" response } }
10 { $description "Creates a response which redirects the client to the given URL." } ;
11
12 HELP: <secure-only>
13 { $values { "responder" "a responder" } { "secure-only" "a responder" } }
14 { $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." } ;
15
16 HELP: <secure-redirect>
17 { $values
18      { "url" url }
19      { "response" response }
20 }
21 { $description "Creates a responder which unconditionally redirects the client to the given URL after setting its protocol to HTTPS." }
22 { $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." } ;
23
24 HELP: >secure-url
25 { $values
26      { "url" url }
27      { "url'" url }
28 }
29 { $description "Sets the protocol of a URL to HTTPS." } ;
30
31 HELP: if-secure
32 { $values
33      { "quot" quotation }
34      { "response" response }
35 }
36 { $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." } ;
37
38 ARTICLE: "furnace.redirection.secure" "Secure redirection"
39 "The words in this section help with implementing sites which require SSL/TLS for additional security."
40 $nl
41 "Converting a HTTP URL into an HTTPS URL:"
42 { $subsections >secure-url }
43 "Redirecting the client to an HTTPS URL:"
44 { $subsections <secure-redirect> }
45 "Tools for writing responders which require SSL/TLS connections:"
46 { $subsections
47     if-secure
48     <secure-only>
49 } ;
50
51 ARTICLE: "furnace.redirection" "Furnace redirection support"
52 "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 " { $vocab-link "furnace.asides" } " and " { $vocab-link "furnace.conversations" } "."
53 $nl
54 "A redirection response which takes asides and conversations into account:"
55 { $subsections <redirect> }
56 "A responder which unconditionally redirects the client to another URL:"
57 { $subsections
58     <redirect-responder>
59     "furnace.redirection.secure"
60 } ;
61
62 ABOUT: "furnace.redirection"