don't worry about length of response status code

This commit is contained in:
Jonathan Lamothe 2021-11-25 03:26:36 -05:00
parent 14f2064050
commit 465b5a9115

View File

@ -147,14 +147,11 @@ unescapeString str = case decodeUtf8' $ BS.pack $ toBytes str of
encodeGemResponse :: GemResponse -> BSL.ByteString
encodeGemResponse resp = let
code = respStatus resp
high = code `div` 10
low = code `mod` 10
meta = respMeta resp
body = fromMaybe "" $ respBody resp
builder
= word8Dec high
<> word8Dec low
= word8Dec code
<> charUtf8 ' '
<> stringUtf8 meta
<> stringUtf8 "\r\n"