http-types 0.9.1 → 0.10
raw patch · 7 files changed
+59/−16 lines, 7 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
- Network.HTTP.Types: imATeaPot418 :: Status
- Network.HTTP.Types.Status: imATeaPot418 :: Status
+ Network.HTTP.Types: imATeapot418 :: Status
+ Network.HTTP.Types.Header: hContentDisposition :: HeaderName
+ Network.HTTP.Types.Header: hMIMEVersion :: HeaderName
+ Network.HTTP.Types.Header: hOrigin :: HeaderName
+ Network.HTTP.Types.Header: hSetCookie :: HeaderName
+ Network.HTTP.Types.Status: imATeapot418 :: Status
+ Network.HTTP.Types.Status: status426 :: Status
+ Network.HTTP.Types.Status: upgradeRequired426 :: Status
+ Network.HTTP.Types.Version: http20 :: HttpVersion
Files
- CHANGELOG +8/−0
- Network/HTTP/Types.hs +1/−1
- Network/HTTP/Types/Header.hs +21/−5
- Network/HTTP/Types/Status.hs +17/−3
- Network/HTTP/Types/URI.hs +5/−5
- Network/HTTP/Types/Version.hs +5/−0
- http-types.cabal +2/−2
CHANGELOG view
@@ -1,3 +1,11 @@+* 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.
Network/HTTP/Types.hs view
@@ -93,7 +93,7 @@ , status417 , expectationFailed417 , status418-, imATeaPot418+, imATeapot418 , status500 , internalServerError500 , status501
Network/HTTP/Types/Header.hs view
@@ -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@@ -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"@@ -142,6 +144,20 @@ hVia = "Via" 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). --
Network/HTTP/Types/Status.hs view
@@ -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@@ -464,8 +468,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>)@@ -476,6 +480,16 @@ -- (<https://tools.ietf.org/html/rfc4918 RFC 4918>) 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>)
Network/HTTP/Types/URI.hs view
@@ -145,7 +145,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 +155,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 =@@ -280,7 +280,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,7 +310,7 @@ | "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 @@ -322,5 +322,5 @@ -- | 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)
Network/HTTP/Types/Version.hs view
@@ -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
http-types.cabal view
@@ -1,5 +1,5 @@ Name: http-types-Version: 0.9.1+Version: 0.10 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.10 Source-repository head type: git