@@ -104,38 +104,38 @@ caseParseRequestBody = do
104 result3' `shouldBe` expected3
104 result3' `shouldBe` expected3
106 it "parsing with memory limit" $ do
106 it "parsing with memory limit" $ do
107− SRequest req4 bod4 <- toRequest'' ctype3 content3
107+ SRequest req4 _bod4 <- toRequest'' ctype3 content3
108 result4' <- parseRequestBodyEx ( setMaxRequestNumFiles 1 $ setMaxRequestKeyLength 14 def ) lbsBackEnd req4
108 result4' <- parseRequestBodyEx ( setMaxRequestNumFiles 1 $ setMaxRequestKeyLength 14 def ) lbsBackEnd req4
109 result4' `shouldBe` expected3
109 result4' `shouldBe` expected3
111 it "exceeding number of files" $ do
111 it "exceeding number of files" $ do
112− SRequest req4 bod4 <- toRequest'' ctype3 content3
112+ SRequest req4 _bod4 <- toRequest'' ctype3 content3
113 (parseRequestBodyEx ( setMaxRequestNumFiles 0 def ) lbsBackEnd req4) `shouldThrow` anyErrorCall
113 (parseRequestBodyEx ( setMaxRequestNumFiles 0 def ) lbsBackEnd req4) `shouldThrow` anyErrorCall
115 it "exceeding parameter length" $ do
115 it "exceeding parameter length" $ do
116− SRequest req4 bod4 <- toRequest'' ctype3 content3
116+ SRequest req4 _bod4 <- toRequest'' ctype3 content3
117 (parseRequestBodyEx ( setMaxRequestKeyLength 2 def ) lbsBackEnd req4) `shouldThrow` anyErrorCall
117 (parseRequestBodyEx ( setMaxRequestKeyLength 2 def ) lbsBackEnd req4) `shouldThrow` anyErrorCall
119 it "exceeding file size" $ do
119 it "exceeding file size" $ do
120− SRequest req4 bod4 <- toRequest'' ctype3 content3
120+ SRequest req4 _bod4 <- toRequest'' ctype3 content3
121 (parseRequestBodyEx ( setMaxRequestFileSize 2 def ) lbsBackEnd req4) `shouldThrow` anyErrorCall
121 (parseRequestBodyEx ( setMaxRequestFileSize 2 def ) lbsBackEnd req4) `shouldThrow` anyErrorCall
123 it "exceeding total file size" $ do
123 it "exceeding total file size" $ do
124− SRequest req4 bod4 <- toRequest'' ctype3 content3
124+ SRequest req4 _bod4 <- toRequest'' ctype3 content3
125 (parseRequestBodyEx ( setMaxRequestFilesSize 20 def ) lbsBackEnd req4) `shouldThrow` anyErrorCall
125 (parseRequestBodyEx ( setMaxRequestFilesSize 20 def ) lbsBackEnd req4) `shouldThrow` anyErrorCall
126− SRequest req5 bod5 <- toRequest'' ctype3 content5
126+ SRequest req5 _bod5 <- toRequest'' ctype3 content5
127 (parseRequestBodyEx ( setMaxRequestFilesSize 20 def ) lbsBackEnd req5) `shouldThrow` anyErrorCall
127 (parseRequestBodyEx ( setMaxRequestFilesSize 20 def ) lbsBackEnd req5) `shouldThrow` anyErrorCall
129 it "exceeding max parm value size" $ do
129 it "exceeding max parm value size" $ do
130− SRequest req4 bod4 <- toRequest'' ctype2 content2
130+ SRequest req4 _bod4 <- toRequest'' ctype2 content2
131 (parseRequestBodyEx ( setMaxRequestParmsSize 10 def ) lbsBackEnd req4) `shouldThrow` anyErrorCall
131 (parseRequestBodyEx ( setMaxRequestParmsSize 10 def ) lbsBackEnd req4) `shouldThrow` anyErrorCall
133 it "exceeding max header lines" $ do
133 it "exceeding max header lines" $ do
134− SRequest req4 bod4 <- toRequest'' ctype2 content2
134+ SRequest req4 _bod4 <- toRequest'' ctype2 content2
135 (parseRequestBodyEx ( setMaxHeaderLines 1 def ) lbsBackEnd req4) `shouldThrow` anyErrorCall
135 (parseRequestBodyEx ( setMaxHeaderLines 1 def ) lbsBackEnd req4) `shouldThrow` anyErrorCall
137 it "exceeding header line size" $ do
137 it "exceeding header line size" $ do
138− SRequest req4 bod4 <- toRequest'' ctype2 content4
138+ SRequest req4 _bod4 <- toRequest'' ctype3 content4
139 (parseRequestBodyEx ( setMaxHeaderLineLength 8190 def ) lbsBackEnd req4) `shouldThrow` anyErrorCall
139 (parseRequestBodyEx ( setMaxHeaderLineLength 8190 def ) lbsBackEnd req4) `shouldThrow` anyErrorCall
141 it "Testing parseRequestBodyEx with application/x-www-form-urlencoded" $ do
141 it "Testing parseRequestBodyEx with application/x-www-form-urlencoded" $ do
@@ -177,13 +177,14 @@ caseParseRequestBody = do
177 <> "------WebKitFormBoundaryB1pWXPZ6lNr8RiLh--\r\n"
177 <> "------WebKitFormBoundaryB1pWXPZ6lNr8RiLh--\r\n"
178 content4 =
178 content4 =
179 "------WebKitFormBoundaryB1pWXPZ6lNr8RiLh\r\n"
179 "------WebKitFormBoundaryB1pWXPZ6lNr8RiLh\r\n"
180− <> "Content-Disposition: form-data; name=\"yaml\"; filename=\"README\"\r\n"
180+ <> "Content-Disposition: form-data; name=\"alb\"; filename=\"README\"\r\n"
181 <> "Content-Type: application/octet-stream\r\n\r\n"
181 <> "Content-Type: application/octet-stream\r\n\r\n"
182− <> "Photo blog using Hack.\n\r\n"
182+ <> "Photo blog using Hack.\r\n\r\n"
183 <> "------WebKitFormBoundaryB1pWXPZ6lNr8RiLh\r\n"
183 <> "------WebKitFormBoundaryB1pWXPZ6lNr8RiLh\r\n"
184− <> "Content-Disposition: form-data; name=\"bla\"; filename=\"riedmie\"\r\n"
184+ <> "Content-Disposition: form-data; name=\"bla\"; filename=\"riedmi"
185+ <> S8.replicate 8190 'e' <> "\"\r\n"
185− <> "Content-Type: application/octet-stream=TOOLONG=" <> S8.replicate 8192 '=' <> "\r\n\r\n"
186+ <> "Content-Type: application/octet-stream\r\n\r\n"
186− <> "Photo blog using Hack.\n\r\n"
187+ <> "Photo blog using Hack.\r\n\r\n"
187 <> "------WebKitFormBoundaryB1pWXPZ6lNr8RiLh--\r\n"
188 <> "------WebKitFormBoundaryB1pWXPZ6lNr8RiLh--\r\n"
188 content5 =
189 content5 =
189 "------WebKitFormBoundaryB1pWXPZ6lNr8RiLh\r\n"
190 "------WebKitFormBoundaryB1pWXPZ6lNr8RiLh\r\n"