capability reply must be a subset of what git sent so filter it

This commit is contained in:
Joey Hess 2018-08-10 16:24:06 -04:00
parent d0dfee1519
commit c6884989dc
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38

View file

@ -70,11 +70,11 @@ versionPkt = formatKV "version" fromVersion
-- the Server.
handshake
:: (Role -> Either String Role) -- ^ role selection function
-> ([Capability] -> [Capability]) -- ^ capability selection function
-> (Capability -> Bool) -- ^ capability selection function
-> Handle -- ^ handle to receive data from git
-> Handle -- ^ handle to send data to git
-> IO (Either String (Role, [Capability]))
handshake selectrole selectcapabilities input output =
handshake selectrole selectcapability input output =
getpkt pktRole $ \role ->
checkversion $ do
case selectrole role of
@ -120,7 +120,7 @@ handshake selectrole selectcapabilities input output =
"git is using an unsupported protocol version: " ++ show versions
exchangecaps cnt = getpkts pktCapability $ \caps -> do
let mycaps = selectcapabilities caps
let mycaps = filter selectcapability caps
sendpkts capabilityPkt mycaps $
cnt mycaps