Hello community,

here is the log from the commit of package ghc-http-types for openSUSE:Factory 
checked in at 2018-05-30 12:09:59
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-http-types (Old)
 and      /work/SRC/openSUSE:Factory/.ghc-http-types.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "ghc-http-types"

Wed May 30 12:09:59 2018 rev:6 rq:607823 version:0.12.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-http-types/ghc-http-types.changes    
2017-09-15 21:50:51.105491853 +0200
+++ /work/SRC/openSUSE:Factory/.ghc-http-types.new/ghc-http-types.changes       
2018-05-30 12:26:07.608695764 +0200
@@ -1,0 +2,14 @@
+Mon May 14 17:02:11 UTC 2018 - [email protected]
+
+- Update http-types to version 0.12.1.
+  * Add new functions for constructing a query URI where not all parts are 
escaped.
+  * URI encoding is now back to upper-case hexadecimal, as that is the 
preferred canonicalization, and the previous change caused issues with URI
+  * signing in at least amazonka.
+  * Remove dependency on blaze-builder. (Note that as a side effect of this, 
URI encoding is now using lower-case rather than uppercase hexadecimal.)
+  * Add Bounded instance to Status.
+  * Re-export more status codes and http20 from Network.HTTP.Types.
+  * New status codes, new headers.
+  * Fixed typo in imATeapot, added missing toEnum.
+  * Oh, and http20.
+
+-------------------------------------------------------------------

Old:
----
  http-types-0.9.1.tar.gz

New:
----
  http-types-0.12.1.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ ghc-http-types.spec ++++++
--- /var/tmp/diff_new_pack.7uSbdH/_old  2018-05-30 12:26:08.832654648 +0200
+++ /var/tmp/diff_new_pack.7uSbdH/_new  2018-05-30 12:26:08.836654514 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package ghc-http-types
 #
-# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -19,7 +19,7 @@
 %global pkg_name http-types
 %bcond_with tests
 Name:           ghc-%{pkg_name}
-Version:        0.9.1
+Version:        0.12.1
 Release:        0
 Summary:        Generic HTTP types for Haskell (for both client and server 
code)
 License:        BSD-3-Clause
@@ -28,7 +28,6 @@
 Source0:        
https://hackage.haskell.org/package/%{pkg_name}-%{version}/%{pkg_name}-%{version}.tar.gz
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-array-devel
-BuildRequires:  ghc-blaze-builder-devel
 BuildRequires:  ghc-bytestring-devel
 BuildRequires:  ghc-case-insensitive-devel
 BuildRequires:  ghc-rpm-macros
@@ -73,7 +72,7 @@
 %ghc_pkg_recache
 
 %files -f %{name}.files
-%doc LICENSE
+%license LICENSE
 
 %files devel -f %{name}-devel.files
 %doc CHANGELOG README

++++++ http-types-0.9.1.tar.gz -> http-types-0.12.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/http-types-0.9.1/CHANGELOG 
new/http-types-0.12.1/CHANGELOG
--- old/http-types-0.9.1/CHANGELOG      2016-06-04 18:07:02.000000000 +0200
+++ new/http-types-0.12.1/CHANGELOG     2018-01-31 21:18:52.000000000 +0100
@@ -1,3 +1,28 @@
+* 0.12.1 [2018-01-31]
+
+Add new functions for constructing a query URI where not all parts are escaped.
+
+* 0.12 [2018-01-28]
+
+URI encoding is now back to upper-case hexadecimal, as that is the preferred 
canonicalization, and the previous change caused issues with URI
+signing in at least amazonka.
+
+* 0.11 [2017-11-29]
+
+Remove dependency on blaze-builder. (Note that as a side effect of this, URI 
encoding is now using lower-case rather than uppercase hexadecimal.)
+
+Add Bounded instance to Status.
+
+Re-export more status codes and http20 from Network.HTTP.Types.
+
+* 0.10 [2017-10-22]
+
+New status codes, new headers.
+
+Fixed typo in imATeapot, added missing toEnum.
+
+Oh, and http20.
+
 * 0.9.1 [2016-06-04]
 
 New function: parseByteRanges.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/http-types-0.9.1/Network/HTTP/Types/Header.hs 
new/http-types-0.12.1/Network/HTTP/Types/Header.hs
--- old/http-types-0.9.1/Network/HTTP/Types/Header.hs   2016-06-04 
18:07:02.000000000 +0200
+++ new/http-types-0.12.1/Network/HTTP/Types/Header.hs  2018-01-31 
21:18:52.000000000 +0100
@@ -24,7 +24,6 @@
 , hContentMD5
 , hContentRange
 , hContentType
-, hCookie
 , hDate
 , hETag
 , hExpect
@@ -39,6 +38,7 @@
 , hLastModified
 , hLocation
 , hMaxForwards
+, hOrigin
 , hPragma
 , hProxyAuthenticate
 , hProxyAuthorization
@@ -55,6 +55,10 @@
 , hVia
 , hWWWAuthenticate
 , hWarning
+, hContentDisposition
+, hMIMEVersion
+, hCookie
+, hSetCookie
   -- ** Byte ranges
 , ByteRange(..)
 , renderByteRangeBuilder
@@ -70,10 +74,10 @@
 #if __GLASGOW_HASKELL__ < 710
 import           Data.Monoid
 #endif
-import qualified Blaze.ByteString.Builder       as Blaze
-import qualified Blaze.ByteString.Builder.Char8 as Blaze
 import qualified Data.ByteString                as B
 import qualified Data.ByteString.Char8          as B8
+import qualified Data.ByteString.Builder        as B
+import qualified Data.ByteString.Lazy           as BL
 import qualified Data.CaseInsensitive           as CI
 import           Data.ByteString.Char8          () {-IsString-}
 import           Data.Typeable                  (Typeable)
@@ -91,9 +95,8 @@
 -- | Response Headers
 type ResponseHeaders = [Header]
 
--- | HTTP Header names
--- According to http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html
-hAccept, hAcceptCharset, hAcceptEncoding, hAcceptLanguage, hAcceptRanges, 
hAge, hAllow, hAuthorization, hCacheControl, hConnection, hContentEncoding, 
hContentLanguage, hContentLength, hContentLocation, hContentMD5, hContentRange, 
hContentType, hCookie, hDate, hETag, hExpect, hExpires, hFrom, hHost, hIfMatch, 
hIfModifiedSince, hIfNoneMatch, hIfRange, hIfUnmodifiedSince, hLastModified, 
hLocation, hMaxForwards, hPragma, hProxyAuthenticate, hProxyAuthorization, 
hRange, hReferer, hRetryAfter, hServer, hTE, hTrailer, hTransferEncoding, 
hUpgrade, hUserAgent, hVary, hVia, hWWWAuthenticate, hWarning :: HeaderName
+-- | HTTP Header names according to 
http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html
+hAccept, hAcceptCharset, hAcceptEncoding, hAcceptLanguage, hAcceptRanges, 
hAge, hAllow, hAuthorization, hCacheControl, hConnection, hContentEncoding, 
hContentLanguage, hContentLength, hContentLocation, hContentMD5, hContentRange, 
hContentType, hDate, hETag, hExpect, hExpires, hFrom, hHost, hIfMatch, 
hIfModifiedSince, hIfNoneMatch, hIfRange, hIfUnmodifiedSince, hLastModified, 
hLocation, hMaxForwards, hPragma, hProxyAuthenticate, hProxyAuthorization, 
hRange, hReferer, hRetryAfter, hServer, hTE, hTrailer, hTransferEncoding, 
hUpgrade, hUserAgent, hVary, hVia, hWWWAuthenticate, hWarning :: HeaderName
 hAccept             = "Accept"
 hAcceptCharset      = "Accept-Charset"
 hAcceptEncoding     = "Accept-Encoding"
@@ -111,7 +114,6 @@
 hContentMD5         = "Content-MD5"
 hContentRange       = "Content-Range"
 hContentType        = "Content-Type"
-hCookie             = "Cookie"
 hDate               = "Date"
 hETag               = "ETag"
 hExpect             = "Expect"
@@ -143,6 +145,20 @@
 hWWWAuthenticate    = "WWW-Authenticate"
 hWarning            = "Warning"
 
+-- | HTTP Header names according to 
http://www.w3.org/Protocols/rfc2616/rfc2616-sec19.html
+hContentDisposition, hMIMEVersion :: HeaderName
+hContentDisposition = "Content-Disposition"
+hMIMEVersion        = "MIME-Version"
+
+-- | HTTP Header names according to 
https://tools.ietf.org/html/rfc6265#section-4
+hCookie, hSetCookie :: HeaderName
+hCookie             = "Cookie"
+hSetCookie          = "Set-Cookie"
+
+-- | HTTP Header names according to https://tools.ietf.org/html/rfc6454
+hOrigin :: HeaderName
+hOrigin = "Origin"
+
 -- | RFC 2616 Byte range (individual).
 --
 -- Negative indices are not allowed!
@@ -152,23 +168,23 @@
   | ByteRangeSuffix !Integer
   deriving (Show, Eq, Ord, Typeable, Data)
 
-renderByteRangeBuilder :: ByteRange -> Blaze.Builder
-renderByteRangeBuilder (ByteRangeFrom from) = Blaze.fromShow from `mappend` 
Blaze.fromChar '-'
-renderByteRangeBuilder (ByteRangeFromTo from to) = Blaze.fromShow from 
`mappend` Blaze.fromChar '-' `mappend` Blaze.fromShow to
-renderByteRangeBuilder (ByteRangeSuffix suffix) = Blaze.fromChar '-' `mappend` 
Blaze.fromShow suffix
+renderByteRangeBuilder :: ByteRange -> B.Builder
+renderByteRangeBuilder (ByteRangeFrom from) = B.integerDec from `mappend` 
B.char7 '-'
+renderByteRangeBuilder (ByteRangeFromTo from to) = B.integerDec from `mappend` 
B.char7 '-' `mappend` B.integerDec to
+renderByteRangeBuilder (ByteRangeSuffix suffix) = B.char7 '-' `mappend` 
B.integerDec suffix
 
 renderByteRange :: ByteRange -> B.ByteString
-renderByteRange = Blaze.toByteString . renderByteRangeBuilder
+renderByteRange = BL.toStrict . B.toLazyByteString . renderByteRangeBuilder
 
 -- | RFC 2616 Byte ranges (set).
 type ByteRanges = [ByteRange]
 
-renderByteRangesBuilder :: ByteRanges -> Blaze.Builder
-renderByteRangesBuilder xs = Blaze.copyByteString "bytes=" `mappend` 
-                             mconcat (intersperse (Blaze.fromChar ',') (map 
renderByteRangeBuilder xs))
+renderByteRangesBuilder :: ByteRanges -> B.Builder
+renderByteRangesBuilder xs = B.byteString "bytes=" `mappend`
+                             mconcat (intersperse (B.char7 ',') (map 
renderByteRangeBuilder xs))
 
 renderByteRanges :: ByteRanges -> B.ByteString
-renderByteRanges = Blaze.toByteString . renderByteRangesBuilder
+renderByteRanges = BL.toStrict . B.toLazyByteString . renderByteRangesBuilder
 
 -- | Parse the value of a Range header into a 'ByteRanges'.
 --
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/http-types-0.9.1/Network/HTTP/Types/Status.hs 
new/http-types-0.12.1/Network/HTTP/Types/Status.hs
--- old/http-types-0.9.1/Network/HTTP/Types/Status.hs   2016-06-04 
18:07:02.000000000 +0200
+++ new/http-types-0.12.1/Network/HTTP/Types/Status.hs  2018-01-31 
21:18:52.000000000 +0100
@@ -73,9 +73,11 @@
 , status417
 , expectationFailed417
 , status418
-, imATeaPot418
+, imATeapot418
 , status422
 , unprocessableEntity422
+, status426
+, upgradeRequired426
 , status428
 , preconditionRequired428
 , status429
@@ -162,7 +164,9 @@
     toEnum 415 = status415
     toEnum 416 = status416
     toEnum 417 = status417
+    toEnum 418 = status418
     toEnum 422 = status422
+    toEnum 426 = status426
     toEnum 428 = status428
     toEnum 429 = status429
     toEnum 431 = status431
@@ -175,9 +179,13 @@
     toEnum 511 = status511
     toEnum c   = mkStatus c B.empty
 
+instance Bounded Status where
+  minBound = status100
+  maxBound = status511
+
 -- | Create a Status from status code and message.
 mkStatus :: Int -> B.ByteString -> Status
-mkStatus i m = Status i m
+mkStatus = Status
 
 -- | Continue 100
 status100 :: Status
@@ -464,8 +472,8 @@
 status418 = mkStatus 418 "I'm a teapot"
 
 -- | I'm a teapot 418
-imATeaPot418 :: Status
-imATeaPot418 = status418
+imATeapot418 :: Status
+imATeapot418 = status418
 
 -- | Unprocessable Entity 422
 -- (<https://tools.ietf.org/html/rfc4918 RFC 4918>)
@@ -477,6 +485,16 @@
 unprocessableEntity422 :: Status
 unprocessableEntity422 = status422
 
+-- | Upgrade Required 426
+-- (<https://tools.ietf.org/html/rfc7231#section-6.5.15>)
+status426 :: Status
+status426 = mkStatus 426 "Upgrade Required"
+
+-- | Upgrade Required 426
+-- (<https://tools.ietf.org/html/rfc7231#section-6.5.15>)
+upgradeRequired426 :: Status
+upgradeRequired426 = status426
+
 -- | Precondition Required 428
 -- (<https://tools.ietf.org/html/rfc6585 RFC 6585>)
 status428 :: Status
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/http-types-0.9.1/Network/HTTP/Types/URI.hs 
new/http-types-0.12.1/Network/HTTP/Types/URI.hs
--- old/http-types-0.9.1/Network/HTTP/Types/URI.hs      2016-06-04 
18:07:02.000000000 +0200
+++ new/http-types-0.12.1/Network/HTTP/Types/URI.hs     2018-01-31 
21:18:52.000000000 +0100
@@ -12,6 +12,12 @@
 , renderSimpleQuery
 , parseQuery
 , parseSimpleQuery
+  -- **Escape only parts
+, renderQueryPartialEscape
+, renderQueryBuilderPartialEscape
+, EscapeItem(..)
+, PartialEscapeQueryItem
+, PartialEscapeQuery
   -- ** Text query string (UTF8 encoded)
 , QueryText
 , queryTextToQuery
@@ -45,8 +51,9 @@
 import           Data.Text.Encoding             (encodeUtf8, decodeUtf8With)
 import           Data.Text.Encoding.Error       (lenientDecode)
 import           Data.Word
-import qualified Blaze.ByteString.Builder       as Blaze
 import qualified Data.ByteString                as B
+import qualified Data.ByteString.Builder        as B
+import qualified Data.ByteString.Lazy           as BL
 import           Data.ByteString.Char8          () {-IsString-}
 
 -- | Query item
@@ -65,10 +72,10 @@
 queryTextToQuery :: QueryText -> Query
 queryTextToQuery = map $ encodeUtf8 *** fmap encodeUtf8
 
--- | Convert 'QueryText' to a 'Blaze.Builder'.
+-- | Convert 'QueryText' to a 'B.Builder'.
 renderQueryText :: Bool -- ^ prepend a question mark?
                 -> QueryText
-                -> Blaze.Builder
+                -> B.Builder
 renderQueryText b = renderQueryBuilder b . queryTextToQuery
 
 -- | Convert 'Query' to 'QueryText' (leniently decoding the UTF-8).
@@ -90,21 +97,21 @@
 
 -- | Convert 'SimpleQuery' to 'Query'.
 simpleQueryToQuery :: SimpleQuery -> Query
-simpleQueryToQuery = map (\(a, b) -> (a, Just b))
+simpleQueryToQuery = map (second Just)
 
 -- | Convert 'Query' to a 'Builder'.
 renderQueryBuilder :: Bool -- ^ prepend a question mark?
                    -> Query
-                   -> Blaze.Builder
+                   -> B.Builder
 renderQueryBuilder _ [] = mempty
 -- FIXME replace mconcat + map with foldr
 renderQueryBuilder qmark' (p:ps) = mconcat
     $ go (if qmark' then qmark else mempty) p
     : map (go amp) ps
   where
-    qmark = Blaze.copyByteString "?"
-    amp = Blaze.copyByteString "&"
-    equal = Blaze.copyByteString "="
+    qmark = B.byteString "?"
+    amp = B.byteString "&"
+    equal = B.byteString "="
     go sep (k, mv) = mconcat [
                       sep
                      , urlEncodeBuilder True k
@@ -116,7 +123,7 @@
 -- | Convert 'Query' to 'ByteString'.
 renderQuery :: Bool -- ^ prepend question mark?
             -> Query -> B.ByteString
-renderQuery qm = Blaze.toByteString . renderQueryBuilder qm
+renderQuery qm = BL.toStrict . B.toLazyByteString . renderQueryBuilder qm
 
 -- | Convert 'SimpleQuery' to 'ByteString'.
 renderSimpleQuery :: Bool -- ^ prepend question mark?
@@ -145,7 +152,7 @@
          in parsePair x : parseQueryString' xs
       where
         parsePair x =
-            let (k, v) = B.breakByte 61 x -- equal sign
+            let (k, v) = B.break (== 61) x -- equal sign
                 v'' =
                     case B.uncons v of
                         Just (_, v') -> Just $ urlDecode True v'
@@ -155,7 +162,7 @@
 queryStringSeparators :: B.ByteString
 queryStringSeparators = B.pack [38,59] -- ampersand, semicolon
 
--- | Break the second bytestring at the first occurence of any bytes from
+-- | Break the second bytestring at the first occurrence of any bytes from
 -- the first bytestring, discarding that byte.
 breakDiscard :: B.ByteString -> B.ByteString -> (B.ByteString, B.ByteString)
 breakDiscard seps s =
@@ -174,26 +181,28 @@
 unreservedPI = map ord8 "-_.~:@&=+$,"
 
 -- | Percent-encoding for URLs.
-urlEncodeBuilder' :: [Word8] -> B.ByteString -> Blaze.Builder
+urlEncodeBuilder' :: [Word8] -> B.ByteString -> B.Builder
 urlEncodeBuilder' extraUnreserved = mconcat . map encodeChar . B.unpack
     where
-      encodeChar ch | unreserved ch = Blaze.fromWord8 ch
+      encodeChar ch | unreserved ch = B.word8 ch
                     | otherwise     = h2 ch
-      
+
       unreserved ch | ch >= 65 && ch <= 90  = True -- A-Z
                     | ch >= 97 && ch <= 122 = True -- a-z
                     | ch >= 48 && ch <= 57  = True -- 0-9
       unreserved c = c `elem` extraUnreserved
-      
-      h2 v = let (a, b) = v `divMod` 16 in Blaze.fromWord8s [37, h a, h b] -- 
percent (%)
+
+      -- must be upper-case
+      h2 v = B.word8 37 `mappend` B.word8 (h a) `mappend` B.word8 (h b) -- 37 
= %
+          where (a, b) = v `divMod` 16
       h i | i < 10    = 48 + i -- zero (0)
           | otherwise = 65 + i - 10 -- 65: A
 
--- | Percent-encoding for URLs (using 'Blaze.Builder').
+-- | Percent-encoding for URLs (using 'B.Builder').
 urlEncodeBuilder
     :: Bool -- ^ Whether input is in query string. True: Query string, False: 
Path element
     -> B.ByteString
-    -> Blaze.Builder
+    -> B.Builder
 urlEncodeBuilder True  = urlEncodeBuilder' unreservedQS
 urlEncodeBuilder False = urlEncodeBuilder' unreservedPI
 
@@ -201,7 +210,7 @@
 urlEncode :: Bool -- ^ Whether to decode '+' to ' '
           -> B.ByteString -- ^ The ByteString to encode as URL
           -> B.ByteString -- ^ The encoded URL
-urlEncode q = Blaze.toByteString . urlEncodeBuilder q
+urlEncode q = BL.toStrict . B.toLazyByteString . urlEncodeBuilder q
 
 -- | Percent-decoding.
 urlDecode :: Bool -- ^ Whether to decode '+' to ' '
@@ -254,18 +263,14 @@
 -- Huge thanks to Jeremy Shaw who created the original implementation of this
 -- function in web-routes and did such thorough research to determine all
 -- correct escaping procedures.
-encodePathSegments :: [Text] -> Blaze.Builder
-encodePathSegments [] = mempty
-encodePathSegments (x:xs) =
-    Blaze.copyByteString "/"
-    `mappend` encodePathSegment x
-    `mappend` encodePathSegments xs
+encodePathSegments :: [Text] -> B.Builder
+encodePathSegments = foldr (\x -> mappend (B.byteString "/" `mappend` 
encodePathSegment x)) mempty
 
 -- | Like encodePathSegments, but without the initial slash.
-encodePathSegmentsRelative :: [Text] -> Blaze.Builder
-encodePathSegmentsRelative xs = mconcat $ intersperse (Blaze.copyByteString 
"/") (map encodePathSegment xs)
+encodePathSegmentsRelative :: [Text] -> B.Builder
+encodePathSegmentsRelative xs = mconcat $ intersperse (B.byteString "/") (map 
encodePathSegment xs)
 
-encodePathSegment :: Text -> Blaze.Builder
+encodePathSegment :: Text -> B.Builder
 encodePathSegment = urlEncodeBuilder False . encodeUtf8
 
 -- | Parse a list of path segments from a valid URL fragment.
@@ -280,7 +285,7 @@
             Just (47, bs') -> bs' -- 47 == /
             _ -> bs
     go bs =
-        let (x, y) = B.breakByte 47 bs
+        let (x, y) = B.break (== 47) bs
          in decodePathSegment x :
             if B.null y
                 then []
@@ -310,17 +315,65 @@
       | "http://";  `B.isPrefixOf` path = (snd . breakOnSlash . B.drop 7) path
       | "https://"; `B.isPrefixOf` path = (snd . breakOnSlash . B.drop 8) path
       | otherwise                      = path
-    breakOnSlash = B.breakByte 47
+    breakOnSlash = B.break (== 47)
     ensureNonEmpty "" = "/"
     ensureNonEmpty p  = p
 
 -- | Encode a whole path (path segments + query).
-encodePath :: [Text] -> Query -> Blaze.Builder
+encodePath :: [Text] -> Query -> B.Builder
 encodePath x [] = encodePathSegments x
 encodePath x y = encodePathSegments x `mappend` renderQueryBuilder True y
 
 -- | Decode a whole path (path segments + query).
 decodePath :: B.ByteString -> ([Text], Query)
 decodePath b =
-    let (x, y) = B.breakByte 63 b -- question mark
+    let (x, y) = B.break (== 63) b -- question mark
     in (decodePathSegments x, parseQuery y)
+
+-----------------------------------------------------------------------------------------
+
+-- | For some URIs characters must not be URI encoded,
+-- eg '+' or ':' in 
q=a+language:haskell+created:2009-01-01..2009-02-01&sort=stars
+-- The character list unreservedPI instead of unreservedQS would solve this.
+-- But we explicitly decide what part to encode.
+-- This is mandatory when searching for '+': q=%2B+language:haskell.
+data EscapeItem = QE B.ByteString -- will be URL encoded
+                | QN B.ByteString -- will not be url encoded, eg '+' or ':'
+    deriving (Show, Eq, Ord)
+
+-- | Query item
+type PartialEscapeQueryItem = (B.ByteString, [EscapeItem])
+
+-- | Query with some chars that should not be escaped.
+-- 
+-- General form: a=b&c=d:e+f&g=h
+type PartialEscapeQuery = [PartialEscapeQueryItem]
+
+-- | Convert 'PartialEscapeQuery' to 'ByteString'.
+renderQueryPartialEscape :: Bool -- ^ prepend question mark?
+            -> PartialEscapeQuery -> B.ByteString
+renderQueryPartialEscape qm = BL.toStrict . B.toLazyByteString . 
renderQueryBuilderPartialEscape qm
+
+-- | Convert 'PartialEscapeQuery' to a 'Builder'.
+renderQueryBuilderPartialEscape :: Bool -- ^ prepend a question mark?
+                   -> PartialEscapeQuery
+                   -> B.Builder
+renderQueryBuilderPartialEscape _ [] = mempty
+-- FIXME replace mconcat + map with foldr
+renderQueryBuilderPartialEscape qmark' (p:ps) = mconcat
+    $ go (if qmark' then qmark else mempty) p
+    : map (go amp) ps
+  where
+    qmark = B.byteString "?"
+    amp = B.byteString "&"
+    equal = B.byteString "="
+    go sep (k, mv) = mconcat [
+                      sep
+                     , urlEncodeBuilder True k
+                     , case mv of
+                         [] -> mempty
+                         vs -> equal `mappend` (mconcat (map encode vs))
+                     ]
+    encode (QE v) = urlEncodeBuilder True v
+    encode (QN v) = B.byteString v
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/http-types-0.9.1/Network/HTTP/Types/Version.hs 
new/http-types-0.12.1/Network/HTTP/Types/Version.hs
--- old/http-types-0.9.1/Network/HTTP/Types/Version.hs  2016-06-04 
18:07:02.000000000 +0200
+++ new/http-types-0.12.1/Network/HTTP/Types/Version.hs 2018-01-31 
21:18:52.000000000 +0100
@@ -5,6 +5,7 @@
 , http09
 , http10
 , http11
+, http20
 )
 where
 
@@ -34,3 +35,7 @@
 -- | HTTP 1.1
 http11 :: HttpVersion
 http11 = HttpVersion 1 1
+
+-- | HTTP 2.0
+http20 :: HttpVersion
+http20 = HttpVersion 2 0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/http-types-0.9.1/Network/HTTP/Types.hs 
new/http-types-0.12.1/Network/HTTP/Types.hs
--- old/http-types-0.9.1/Network/HTTP/Types.hs  2016-06-04 18:07:02.000000000 
+0200
+++ new/http-types-0.12.1/Network/HTTP/Types.hs 2018-01-31 21:18:52.000000000 
+0100
@@ -21,7 +21,8 @@
 , http09
 , http10
 , http11
-  -- * Status
+, http20
+-- * Status
 , Status(..)
 , mkStatus
 , status100
@@ -56,6 +57,8 @@
 , useProxy305
 , status307
 , temporaryRedirect307
+, status308
+, permanentRedirect308
 , status400
 , badRequest400
 , status401
@@ -93,7 +96,15 @@
 , status417
 , expectationFailed417
 , status418
-, imATeaPot418
+, imATeapot418
+, status422
+, unprocessableEntity422
+, status428
+, preconditionRequired428
+, status429
+, tooManyRequests429
+, status431
+, requestHeaderFieldsTooLarge431
 , status500
 , internalServerError500
 , status501
@@ -106,6 +117,8 @@
 , gatewayTimeout504
 , status505
 , httpVersionNotSupported505
+, status511
+, networkAuthenticationRequired511
 , statusIsInformational
 , statusIsSuccessful
 , statusIsRedirection
@@ -157,6 +170,12 @@
 , renderSimpleQuery
 , parseQuery
 , parseSimpleQuery
+  -- **Escape only parts
+, renderQueryPartialEscape
+, renderQueryBuilderPartialEscape
+, EscapeItem(..)
+, PartialEscapeQueryItem
+, PartialEscapeQuery
   -- *** Text query string (UTF8 encoded)
 , QueryText
 , queryTextToQuery
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/http-types-0.9.1/http-types.cabal 
new/http-types-0.12.1/http-types.cabal
--- old/http-types-0.9.1/http-types.cabal       2016-06-04 18:07:02.000000000 
+0200
+++ new/http-types-0.12.1/http-types.cabal      2018-01-31 21:18:52.000000000 
+0100
@@ -1,5 +1,5 @@
 Name:                http-types
-Version:             0.9.1
+Version:             0.12.1
 Synopsis:            Generic HTTP types for Haskell (for both client and 
server code).
 Description:         Generic HTTP types for Haskell (for both client and 
server code).
 Homepage:            https://github.com/aristidb/http-types
@@ -16,7 +16,7 @@
 Source-repository this
   type: git
   location: https://github.com/aristidb/http-types.git
-  tag: 0.9.1
+  tag: 0.12.1
 
 Source-repository head
   type: git
@@ -32,10 +32,9 @@
                        Network.HTTP.Types.Version
   GHC-Options:         -Wall
   Build-depends:       base >= 4 && < 5,
-                       bytestring >=0.9.1.5 && <0.11,
+                       bytestring >=0.10.4.0 && <1.0,
                        array >=0.2 && <0.6,
                        case-insensitive >=0.2 && <1.3,
-                       blaze-builder >= 0.2.1.4 && < 0.5,
                        text >= 0.11.0.2
 
 Test-suite spec
@@ -47,7 +46,6 @@
                        http-types,
                        text,
                        bytestring,
-                       blaze-builder,
                        QuickCheck,
                        quickcheck-instances,
                        hspec >= 1.3


Reply via email to