on master help sign in
fixing test failures of h2spec.

Empty :path and no :scheme.

commit110726092de8d6ef3827e60bfce93f34a2ecbd06 authorKazu Yamamoto <kazu@iij.ad.jp> dateMon 30 Jan 2017, 12:30 (10 years ago) parent0e0f4db
1 file changed+5−2
warp/Network/Wai/Handler/Warp/HTTP2/HPACK.hs+5−2
warp/Network/Wai/Handler/Warp/HTTP2/HPACK.hs+5−2
@@ -83,13 +83,16 @@ hpackDecodeHeader hdrblk Context{..} = do
8383{-# INLINE checkRequestHeader #-}
8484checkRequestHeader :: ValueTable -> Bool
8585checkRequestHeader reqvt
86+ | just mMethod (== "CONNECT") = mPath == Nothing && mScheme == Nothing
8687 | mStatus /= Nothing = False
8788 | mMethod == Nothing = False
89+ | mScheme == Nothing = False
90+ | mPath == Nothing = False
91+ | mPath == Just "" = False
8892 | mAuthority == Nothing = False
8993 | mConnection /= Nothing = False
9094 | just mTE (/= "trailers") = False
91− | just mMethod (== "CONNECT") = mPath == Nothing && mScheme == Nothing
92− | otherwise = mPath /= Nothing
95+ | otherwise = True
9396 where
9497 mStatus = getHeaderValue tokenStatus reqvt
9598 mScheme = getHeaderValue tokenScheme reqvt