on master help sign in
doc update.
commit6dec773eae2fa722c9315bcc79507261447443da authorKazu Yamamoto <kazu@iij.ad.jp> dateThu 31 Oct 2013, 20:52 (13 years ago) parent70ad779
1 file changed+18−6
warp/Network/Wai/Handler/Warp/Response.hs+18−6
warp/Network/Wai/Handler/Warp/Response.hs+18−6
@@ -84,20 +84,32 @@ checkPartRange fileSize mPart mRange = checkPart mPart mRange
8484
8585-- | Sending a HTTP response to 'Connection' according to 'Response'.
8686--
87+-- The Server header is added if not exist in HTTP response header.
88+--
8789-- ['ResponseFile']
8890-- HTTP response body is sent by sendfile().
89−-- If an application know the file size, it should be
90−-- specified using FilePart (Just).
91−-- If it is Nothing, disk access occurs to obtain its file size.
91+-- Applications are categorized into simple and sophisticated.
92+-- Simple applications should specify 'Nothing' to
93+-- 'Maybe' 'FilePart'. The size of the specified file is obtained
94+-- by disk access. Then Range is handled.
95+-- Sophisticated applications should specify 'Just' to
96+-- 'Maybe' 'FilePart'. They should treat Range (and If-Range) by
97+-- thierselves. In both cases,
9298-- Content-Length and Content-Range (if necessary) are automatically
9399-- added into the HTTP response header.
94100-- If Content-Length and Content-Range exist in the HTTP response header,
95−-- they will cause inconsistency.
101+-- they would cause inconsistency.
96102-- Status is also changed to 206 if necessary.
97103--
98−-- ['ResponseBuilder'] TBD
104+-- ['ResponseSource']
105+-- HTTP response body is created from 'Source'.
106+-- Typically, Transfer-Encoding: chunked is used.
107+-- If Content-Length is specified, Transfer-Encoding: chunked is not used.
99108--
100−-- ['ResponseSource'] TBD
109+-- ['ResponseBuilder']
110+-- HTTP response body is created from 'Builder'.
111+-- Typically, Transfer-Encoding: chunked is used.
112+-- If Content-Length is specified, Transfer-Encoding: chunked is not used.
101113
102114sendResponse :: Connection
103115 -> InternalInfo