@@ -278,11 +278,17 @@ conduitRequestBodyEx o _ UrlEncoded rbody add = do
278 -- NOTE: in general, url-encoded data will be in a single chunk.
278 -- NOTE: in general, url-encoded data will be in a single chunk.
279 -- Therefore, I'm optimizing for the usual case by sticking with
279 -- Therefore, I'm optimizing for the usual case by sticking with
280 -- strict byte strings here.
280 -- strict byte strings here.
281 let loop front = do
282 let loop front = do
282 bs <- rbody
283 bs <- rbody
283 if S.null bs
284 if S.null bs
284 then return $ S.concat $ front []
285 then return $ S.concat $ front []
287+ newsize <- atomicModifyIORef size $
288+ \cursize -> let newsize = cursize + S.length bs in (newsize, newsize)
289+ when (newsize > prboMaxParmsValueSize o) $
290+ error "Maximum size of parameters exceeded"
285− else loop $ front . (bs:)
291+ loop $ front . (bs:)
286 bs <- loop id
292 bs <- loop id
287 mapM_ (add . Left) $ H.parseSimpleQuery bs
293 mapM_ (add . Left) $ H.parseSimpleQuery bs
288conduitRequestBodyEx o backend (Multipart bound) rbody add =
294conduitRequestBodyEx o backend (Multipart bound) rbody add =