on master help sign in
Move the comment about the max. header length to where it makes more sense
ef4106dHans-Christian Esperer
wai-extra/Network/Wai/Parse.hs+3−5
@@ -219,8 +219,9 @@ clearMaxHeaderLineLength p = p { prboMaxHeaderLineLength=Nothing }
219-- maximum files: 10; filesize unlimited; maximum
219-- maximum files: 10; filesize unlimited; maximum
220-- size for parameters: 64kbytes; maximum number of header
220-- size for parameters: 64kbytes; maximum number of header
221-- lines: 32 bytes (applies only to headers of a mime/multipart message);
221-- lines: 32 bytes (applies only to headers of a mime/multipart message);
222−-- maximum header line length: 8190 bytes (applies only to headers of
222+-- maximum header line length: Apache's default for that is 8190 bytes
223−-- a mime/multipart message)
223+-- (http://httpd.apache.org/docs/2.2/mod/core.html#limitrequestline)
224+-- so we're using that here as well.
224defaultParseRequestBodyOptions :: ParseRequestBodyOptions
225defaultParseRequestBodyOptions :: ParseRequestBodyOptions
225defaultParseRequestBodyOptions = ParseRequestBodyOptions
226defaultParseRequestBodyOptions = ParseRequestBodyOptions
226 { prboKeyLength=Just 32
227 { prboKeyLength=Just 32
@@ -380,9 +381,6 @@ conduitRequestBodyEx o backend (Multipart bound) rbody add =
380
381
381
382
382-- | Take one header or subheader line.
383-- | Take one header or subheader line.
383−-- It makes sense to limit the maximum line length.
384−-- Apache's default is 8190 (http://httpd.apache.org/docs/2.2/mod/core.html#limitrequestline)
385−-- so we're using that here as well.
386takeLine :: Maybe Int -> Source -> IO (Maybe S.ByteString)
384takeLine :: Maybe Int -> Source -> IO (Maybe S.ByteString)
387takeLine maxlen src =
385takeLine maxlen src =
388 go ""
386 go ""