summaryrefslogtreecommitdiffhomepage
path: root/HTTP.hs
diff options
context:
space:
mode:
authorJoey Hess <joeyh@joeyh.name>2016-08-20 17:59:14 -0400
committerJoey Hess <joeyh@joeyh.name>2016-08-20 17:59:14 -0400
commit7ed6961a0e0ef713c136a9d36f86bc7e31414dc5 (patch)
tree591fd6c5f60276c946962f8af27ec3def5d9b303 /HTTP.hs
parent3633c44893bfbd50f25b84ac353012975388332c (diff)
downloadkeysafe-7ed6961a0e0ef713c136a9d36f86bc7e31414dc5.tar.gz
http client, and --server
Diffstat (limited to 'HTTP.hs')
-rw-r--r--HTTP.hs6
1 files changed, 6 insertions, 0 deletions
diff --git a/HTTP.hs b/HTTP.hs
index ac4eeab..13a7bda 100644
--- a/HTTP.hs
+++ b/HTTP.hs
@@ -66,9 +66,15 @@ instance FromJSON ProofOfWorkRequirement
instance FromHttpApiData ProofOfWork where
parseUrlPiece = Right . ProofOfWork
+instance ToHttpApiData ProofOfWork where
+ toUrlPiece (ProofOfWork t) = t
+
instance FromHttpApiData StorableObjectIdent where
parseUrlPiece = Right . StorableObjectIdent . T.encodeUtf8
+instance ToHttpApiData StorableObjectIdent where
+ toUrlPiece (StorableObjectIdent b) = T.decodeUtf8 b
+
instance MimeRender OctetStream StorableObject where
mimeRender _ = L.fromStrict . toByteString