http-types 0.6.9 → 0.6.10
raw patch · 2 files changed
+17/−18 lines, 2 filesdep +HUnitdep −asciidep ~case-insensitivedep ~hspecPVP ok
version bump matches the API change (PVP)
Dependencies added: HUnit
Dependencies removed: ascii
Dependency ranges changed: case-insensitive, hspec
API changes (from Hackage documentation)
+ Network.HTTP.Types: encodePathSegmentsRelative :: [Text] -> Builder
Files
- Network/HTTP/Types.hs +13/−7
- http-types.cabal +4/−11
Network/HTTP/Types.hs view
@@ -138,6 +138,7 @@ -- * Path segments , encodePathSegments , decodePathSegments+, encodePathSegmentsRelative -- * Path (segments + query string) , encodePath , decodePath@@ -200,6 +201,7 @@ import Data.Text.Encoding (encodeUtf8, decodeUtf8With) import Data.Text.Encoding.Error (lenientDecode) import Data.Word (Word8)+import Data.List (intersperse) import qualified Blaze.ByteString.Builder as Blaze import qualified Data.ByteString as B import qualified Data.ByteString.Char8 as B8@@ -1026,21 +1028,21 @@ -- -- * Performs percent encoding on all unreserved characters, as well as \:\@\=\+\$, ----- * Intercalates with a slash.+-- * Prepends each segment with a slash. -- -- For example: ----- > encodePathInfo [\"foo\", \"bar\", \"baz\"]+-- > encodePathSegments [\"foo\", \"bar\", \"baz\"] ----- \"foo\/bar\/baz\"+-- \"\/foo\/bar\/baz\" ----- > encodePathInfo [\"foo bar\", \"baz\/bin\"]+-- > encodePathSegments [\"foo bar\", \"baz\/bin\"] ----- \"foo\%20bar\/baz\%2Fbin\"+-- \"\/foo\%20bar\/baz\%2Fbin\" ----- > encodePathInfo [\"שלום\"]+-- > encodePathSegments [\"שלום\"] ----- \"%D7%A9%D7%9C%D7%95%D7%9D\"+-- \"\/%D7%A9%D7%9C%D7%95%D7%9D\" -- -- Huge thanks to Jeremy Shaw who created the original implementation of this -- function in web-routes and did such thorough research to determine all@@ -1051,6 +1053,10 @@ Blaze.copyByteString "/" `mappend` encodePathSegment x `mappend` encodePathSegments xs++-- | Like encodePathSegments, but without the initial slash.+encodePathSegmentsRelative :: [Text] -> Blaze.Builder+encodePathSegmentsRelative xs = mconcat $ intersperse (Blaze.copyByteString "/") (map encodePathSegment xs) encodePathSegment :: Text -> Blaze.Builder encodePathSegment = urlEncodeBuilder False . encodeUtf8
http-types.cabal view
@@ -7,7 +7,7 @@ -- The package version. See the Haskell package versioning policy -- (http://www.haskell.org/haskellwiki/Package_versioning_policy) for -- standards guiding when and how versions should be incremented.-Version: 0.6.9+Version: 0.6.10 -- A short (one-line) description of the package. Synopsis: Generic HTTP types for Haskell (for both client and server code).@@ -45,10 +45,6 @@ -- Constraint on the version of Cabal needed to build this package. Cabal-version: >=1.8 -flag test- description: Build the executable to run unit tests- default: False- Library -- Modules exported by the library. Exposed-modules: Network.HTTP.Types@@ -71,10 +67,7 @@ -- Build-tools: -executable runtests+Test-suite runtests main-is: runtests.hs- if flag(test)- Buildable: True- build-depends: text, bytestring, base, blaze-builder, ascii, array, QuickCheck, hspec >= 0.3 && < 0.4- else- Buildable: False+ type: exitcode-stdio-1.0+ build-depends: text, bytestring, base, blaze-builder, array, case-insensitive, QuickCheck, HUnit, hspec