on master help sign in
Adding test case for ignoring non-urlencoded body data
commit8672c9dc3fba17075d29781bb2ffdc1db1f83bc0 authorLyndon Maydwell <maydwell@gmail.com> dateSat 28 Apr 2012, 17:43 (14 years ago) parent9855d12
1 file changed+4
wai-extra/test/WaiExtraTest.hs+4
wai-extra/test/WaiExtraTest.hs+4
@@ -381,6 +381,10 @@ caseMethodOverridePost = flip runSession mopApp $ do
381381 sres3 <- srequest $ toRequest "application/x-www-form-urlencoded" "foo=bar&_method=PUT&baz=bin"
382382 assertHeader "Method" "POST" sres3
383383
384+ -- Post requests are unmodified if Content-Type header isn't set to "application/x-www-form-urlencoded"
385+ sres4 <- srequest $ toRequest "text/html; charset=utf-8" "foo=bar&_method=PUT&baz=bin"
386+ assertHeader "Method" "POST" sres4
387+
384388aoApp :: Application
385389aoApp = acceptOverride $ \req -> return $ responseLBS status200
386390 [("Accept", fromMaybe "" $ lookup "Accept" $ requestHeaders req)] ""