1{-# LANGUAGE OverloadedStrings #-} 2 3module HPACK.HeaderBlock where 4 5import Data.ByteString (ByteString) 6import Data.ByteString.Base16 7import Network.HPACK 8 9fromHexString :: ByteString -> ByteString 10fromHexString = decodeLenient 11 12---------------------------------------------------------------- 13 14d41h :: HeaderList 15d41h = [(":method","GET") 16 ,(":scheme","http") 17 ,(":path","/") 18 ,(":authority","www.example.com") 19 ] 20 21d41b :: ByteString 22d41b = fromHexString "828684418cf1e3c2e5f23a6ba0ab90f4ff" 23 24d42h :: HeaderList 25d42h = [(":method","GET") 26 ,(":scheme","http") 27 ,(":path","/") 28 ,(":authority","www.example.com") 29 ,("cache-control","no-cache")] 30 31d42b :: ByteString 32d42b = fromHexString "828684be5886a8eb10649cbf" 33 34d43h :: HeaderList 35d43h = [(":method","GET") 36 ,(":scheme","https") 37 ,(":path","/index.html") 38 ,(":authority","www.example.com") 39 ,("custom-key","custom-value") 40 ] 41 42d43b :: ByteString 43d43b = fromHexString "828785bf408825a849e95ba97d7f8925a849e95bb8e8b4bf" 44 45---------------------------------------------------------------- 46 47d61h :: HeaderList 48d61h = [(":status","302") 49 ,("cache-control","private") 50 ,("date","Mon, 21 Oct 2013 20:13:21 GMT") 51 ,("location","https://www.example.com") 52 ] 53 54d61b :: ByteString 55d61b = fromHexString "488264025885aec3771a4b6196d07abe941054d444a8200595040b8166e082a62d1bff6e919d29ad171863c78f0b97c8e9ae82ae43d3" 56 57d62h :: HeaderList 58d62h = [(":status","307") 59 ,("cache-control","private") 60 ,("date","Mon, 21 Oct 2013 20:13:21 GMT") 61 ,("location","https://www.example.com") 62 ] 63 64d62b :: ByteString 65d62b = fromHexString "4883640effc1c0bf" 66 67d63h :: HeaderList 68d63h = [(":status","200") 69 ,("cache-control","private") 70 ,("date","Mon, 21 Oct 2013 20:13:22 GMT") 71 ,("location","https://www.example.com") 72 ,("content-encoding","gzip") 73 ,("set-cookie","foo=ASDJKHQKBZXOQWEOPIUAXQWEOIU; max-age=3600; version=1")] 74 75d63b :: ByteString 76d63b = fromHexString "88c16196d07abe941054d444a8200595040b8166e084a62d1bffc05a839bd9ab77ad94e7821dd7f2e6c7b335dfdfcd5b3960d5af27087f3672c1ab270fb5291f9587316065c003ed4ee5b1063d5007" 77 78---------------------------------------------------------------- 79 80d81h :: HeaderList 81d81h = [(":status","403") 82 ,("server","nginx/1.14.0") 83 ,("date","Wed, 13 Feb 2019 14:57:11 GMT") 84 ,("content-type","text/html") 85 ,("content-length","169") 86 ] 87 88d81b :: ByteString 89d81b = fromHexString "2048033430337689aa6355e580ae1697076196e4593e940b2a612c6a08017d40b571b76e042a62d1bf5f87497ca589d34d1f5c03313639" 90 91