on master help sign in
fixing 0-length body in HTTP/2. (#597)

This is due to careless conversion on refactoring. Firefox sends Header/EoS for 0-length body. Chrome (and probably Safari) sends Header + Data/EoS for 0-length body.

commit1b7a7f8e95219e2de64c2669d53d399f324fd0b1 authorKazu Yamamoto <kazu@iij.ad.jp> dateThu 19 Apr 2018, 14:35 (8 years ago) parentef6573b
1 file changed+1−1
warp/Network/Wai/Handler/Warp/HTTP2/Receiver.hs+1−1
warp/Network/Wai/Handler/Warp/HTTP2/Receiver.hs+1−1
@@ -115,7 +115,7 @@ frameReceiver ctx mkreq recvN = loop 0 `E.catch` sendGoaway
115115 Open (NoBody tbl@(_,reqvt) pri) -> do
116116 resetContinued
117117 let mcl = readInt <$> getHeaderValue tokenContentLength reqvt
118− when (just mcl (== (0 :: Int))) $
118+ when (just mcl (/= (0 :: Int))) $
119119 E.throwIO $ StreamError ProtocolError streamId
120120 writeIORef streamPrecedence $ toPrecedence pri
121121 writeIORef streamState HalfClosed