on master help sign in
UrlMap: Should 404 when no applications match
commit58dcb6454b5b73a36a6d145114d2766ed728a7bd authorHarry Garrood <hdgarrood@gmail.com> dateSat 4 Jan 2014, 00:32 (13 years ago) parenta99e883
2 files changed+4−5
wai-extra/Network/Wai/UrlMap.hs+2−3 wai-extra/test/WaiExtraTest.hs+2−2
wai-extra/Network/Wai/UrlMap.hs+2−3
@@ -91,10 +91,9 @@ instance ToApplication UrlMap where
9191 }
9292 Nothing ->
9393 return $ responseLBS
94− status500
94+ status404
9595 [("content-type", "text/plain")]
96− ("WaiUrlMapper: no routes matched. Consider using \
97− \mountRoot for the last mapping in the 'do' block.\n")
96+ "Not found\n"
9897
9998 where
10099 makeRaw :: [Text] -> B.ByteString
wai-extra/test/WaiExtraTest.hs+2−2
@@ -623,6 +623,6 @@ casesUrlMap = [pair1, pair2, pair3, pair4]
623623 assertHeader "X-rawPathInfo" "/issues/11" res3
624624 assertHeader "X-pathInfo" (s ["issues", "11"]) res3
625625
626− pair4 = makePair "should 500 if none match" $ do
626+ pair4 = makePair "should 404 if none match" $ do
627627 res4 <- get "/api/v3"
628− assertStatus 500 res4
628+ assertStatus 404 res4