From fd70f5e3ed54d5e013c11a3f3e632e80838171d0 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Sat, 23 Jul 2022 02:48:52 +0100 Subject: gentoo auto-resync : 23:07:2022 - 02:48:51 --- dev-haskell/http-media/Manifest | 3 ++ dev-haskell/http-media/http-media-0.8.0.0.ebuild | 39 ++++++++++++++++++++++++ dev-haskell/http-media/metadata.xml | 35 +++++++++++++++++++++ 3 files changed, 77 insertions(+) create mode 100644 dev-haskell/http-media/Manifest create mode 100644 dev-haskell/http-media/http-media-0.8.0.0.ebuild create mode 100644 dev-haskell/http-media/metadata.xml (limited to 'dev-haskell/http-media') diff --git a/dev-haskell/http-media/Manifest b/dev-haskell/http-media/Manifest new file mode 100644 index 000000000000..6682d48f8c2d --- /dev/null +++ b/dev-haskell/http-media/Manifest @@ -0,0 +1,3 @@ +DIST http-media-0.8.0.0.tar.gz 18895 BLAKE2B 3a6db500f6433c6f0bc23f6b51aa5f35b3340a4258b4b5d637bdeafd5161c28af8c2630a013f06a8204a2d37242d5bc880d5c75d32adbf92fb664417872806a2 SHA512 549fa1892c81224e79bad4268993e0cfa324d9d0c9daa0d800ac7cc4eee307405155989672c49adb0e124ca29c2d83cc565ba3c935fd3be4ab4ef0594b012bb5 +EBUILD http-media-0.8.0.0.ebuild 1258 BLAKE2B bcba8ac89f4204e509e59e2ba8d0d0a95dd672780038fe41780f65ff16557ea45a454c2feef847b4977cf872d7c7b4864d150cb86965eeacad37fbc60de9b27d SHA512 953d2382797a4e66731c8b65735f519f439ef2bc5e35ce3e780800cfce5aceb8f6c31c0ab8cd3336b89c1eae9540b93a475e895e1fdfa93a0be67b6d721b4c69 +MISC metadata.xml 1490 BLAKE2B 6421b5165163eab14cafef80c3d7fd7f5153230dc04f9c6fb8fe7b1d81e6f58db3ae139a5f626a6edaefacf897ea3ef54fb28ef9903438054351fa56003df1e4 SHA512 70aabd7e23c3bc43fdeecd3eec7a00fe20e66d024b769e23eef81a51e1c4b5a630c608e67ec052c8caad408caef60338fd4d4fa547bd52b6eb14b5def60d5b98 diff --git a/dev-haskell/http-media/http-media-0.8.0.0.ebuild b/dev-haskell/http-media/http-media-0.8.0.0.ebuild new file mode 100644 index 000000000000..48eb79e3f8fa --- /dev/null +++ b/dev-haskell/http-media/http-media-0.8.0.0.ebuild @@ -0,0 +1,39 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +# ebuild generated by hackport 0.6.9999 + +CABAL_FEATURES="lib profile haddock hoogle hscolour test-suite" +inherit haskell-cabal + +DESCRIPTION="Processing HTTP Content-Type and Accept headers" +HOMEPAGE="https://github.com/zmthy/http-media" +SRC_URI="https://hackage.haskell.org/package/${P}/${P}.tar.gz" + +LICENSE="MIT" +SLOT="0/${PV}" +KEYWORDS="~amd64 ~ppc64 ~x86" +IUSE="" + +RDEPEND=">=dev-haskell/case-insensitive-1.0:=[profile?] =dev-haskell/utf8-string-0.3:=[profile?] =dev-lang/ghc-7.10.1:= +" +DEPEND="${RDEPEND} + >=dev-haskell/cabal-1.22.2.0 + test? ( >=dev-haskell/quickcheck-2.8 + >=dev-haskell/test-framework-0.8 =dev-haskell/test-framework-quickcheck2-0.3 = 4.7 && < 4.13' 'base >= 4.8' \ + 'base >= 4.7 && < 4.13' 'base >= 4.7' \ + 'QuickCheck >= 2.8 && < 2.14' 'QuickCheck >= 2.8' +} diff --git a/dev-haskell/http-media/metadata.xml b/dev-haskell/http-media/metadata.xml new file mode 100644 index 000000000000..8281b91cfa5b --- /dev/null +++ b/dev-haskell/http-media/metadata.xml @@ -0,0 +1,35 @@ + + + + + haskell@gentoo.org + Gentoo Haskell + + + This library is intended to be a comprehensive solution to parsing and + selecting quality-indexed values in HTTP headers. It is capable of parsing + both media types and language parameters from the Accept and Content header + families, and can be extended to match against other accept headers as well. + Selecting the appropriate header value is achieved by comparing a list of + server options against the quality-indexed values supplied by the client. + + In the following example, the Accept header is parsed and then matched against + a list of server options to serve the appropriate media using + 'mapAcceptMedia': + + > getHeader >>= maybe send406Error sendResourceWith . mapAcceptMedia + > [ ("text/html", asHtml) + > , ("application/json", asJson) + > ] + + Similarly, the Content-Type header can be used to produce a parser for request + bodies based on the given content type with 'mapContentMedia': + + > getContentType >>= maybe send415Error readRequestBodyWith . mapContentMedia + > [ ("application/json", parseJson) + > , ("text/plain", parseText) + > ] + + The API is agnostic to your choice of server. + + -- cgit v1.2.3