git.iko.soy/typeable/bloodhound
on master help sign in
Merge pull request #91 from Soostone/request-hook

make respIsTwoHunna more semantic

commit194582d58f54e494869035eab64207756b02e280 authorChris Allen <cma@bitemyapp.com> dateThu 21 Jan 2016, 19:49 (11 years ago) parentc3df597b389fc5
1 file changed+3−3
src/Database/Bloodhound/Client.hs+3−3
src/Database/Bloodhound/Client.hs+3−3
@@ -310,11 +310,11 @@ deepMerge = LS.foldl' go mempty
310310 merge _ b = b
311311
312312
313−statusCodeIs :: Int -> Reply -> Bool
314−statusCodeIs n resp = NHTS.statusCode (responseStatus resp) == n
313+statusCodeIs :: (Int, Int) -> Reply -> Bool
314+statusCodeIs r resp = inRange r $ NHTS.statusCode (responseStatus resp)
315315
316316respIsTwoHunna :: Reply -> Bool
317−respIsTwoHunna = statusCodeIs 200
317+respIsTwoHunna = statusCodeIs (200, 299)
318318
319319existentialQuery :: MonadBH m => Text -> m (Reply, Bool)
320320existentialQuery url = do