Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package ghc-git-lfs for openSUSE:Factory checked in at 2022-02-11 23:07:52 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ghc-git-lfs (Old) and /work/SRC/openSUSE:Factory/.ghc-git-lfs.new.1956 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-git-lfs" Fri Feb 11 23:07:52 2022 rev:6 rq:953392 version:1.2.0 Changes: -------- --- /work/SRC/openSUSE:Factory/ghc-git-lfs/ghc-git-lfs.changes 2021-11-11 21:36:43.772902110 +0100 +++ /work/SRC/openSUSE:Factory/.ghc-git-lfs.new.1956/ghc-git-lfs.changes 2022-02-11 23:09:44.559003783 +0100 @@ -1,0 +2,17 @@ +Wed Nov 10 17:53:01 UTC 2021 - Peter Simons <[email protected]> + +- Update git-lfs to version 1.2.0. + haskell-git-lfs (1.2.0) unstable; urgency=medium + + * Avoid blindly copying over Content-Encoding and Transfer-Encoding + headers provided by the git-lfs server. This fixes interoperation + with gitlab's implementation of the git-lfs protocol, which sends + Transfer-Encoding chunked. + * uploadOperationRequests changed to provide a ServerSupportsChunks + value when constructing the RequestBody. This allows using + Transfer-Encoding chunked when the server supports it. + (API change) + + -- Joey Hess <[email protected]> Wed, 10 Nov 2021 13:52:11 -0400 + +------------------------------------------------------------------- Old: ---- git-lfs-1.1.2.tar.gz New: ---- git-lfs-1.2.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ghc-git-lfs.spec ++++++ --- /var/tmp/diff_new_pack.Xub7ye/_old 2022-02-11 23:09:45.075005275 +0100 +++ /var/tmp/diff_new_pack.Xub7ye/_new 2022-02-11 23:09:45.083005298 +0100 @@ -18,7 +18,7 @@ %global pkg_name git-lfs Name: ghc-%{pkg_name} -Version: 1.1.2 +Version: 1.2.0 Release: 0 Summary: Git-lfs protocol License: AGPL-3.0-or-later ++++++ git-lfs-1.1.2.tar.gz -> git-lfs-1.2.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/git-lfs-1.1.2/CHANGELOG new/git-lfs-1.2.0/CHANGELOG --- old/git-lfs-1.1.2/CHANGELOG 2001-09-09 03:46:40.000000000 +0200 +++ new/git-lfs-1.2.0/CHANGELOG 2001-09-09 03:46:40.000000000 +0200 @@ -1,3 +1,16 @@ +haskell-git-lfs (1.2.0) unstable; urgency=medium + + * Avoid blindly copying over Content-Encoding and Transfer-Encoding + headers provided by the git-lfs server. This fixes interoperation + with gitlab's implementation of the git-lfs protocol, which sends + Transfer-Encoding chunked. + * uploadOperationRequests changed to provide a ServerSupportsChunks + value when constructing the RequestBody. This allows using + Transfer-Encoding chunked when the server supports it. + (API change) + + -- Joey Hess <[email protected]> Wed, 10 Nov 2021 13:52:11 -0400 + haskell-git-lfs (1.1.2) unstable; urgency=medium * Expand aeson bounds to allow 2.x diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/git-lfs-1.1.2/Network/GitLFS.hs new/git-lfs-1.2.0/Network/GitLFS.hs --- old/git-lfs-1.1.2/Network/GitLFS.hs 2001-09-09 03:46:40.000000000 +0200 +++ new/git-lfs-1.2.0/Network/GitLFS.hs 2001-09-09 03:46:40.000000000 +0200 @@ -46,6 +46,7 @@ -- * Making transfers downloadOperationRequest, uploadOperationRequests, + ServerSupportsChunks(..), -- * Endpoint discovery Endpoint, @@ -403,10 +404,10 @@ -- | Builds a http request to perform a download. downloadOperationRequest :: DownloadOperation -> Maybe Request -downloadOperationRequest = operationParamsRequest . download +downloadOperationRequest = fmap fst . operationParamsRequest . download -- | Builds http request to perform an upload. The content to upload is --- provided in the RequestBody, along with its SHA256 and size. +-- provided, along with its SHA256 and size. -- -- When the LFS server requested verification, there will be a second -- Request that does that; it should be run only after the upload has @@ -414,8 +415,8 @@ -- -- When the LFS server already contains the object, an empty list may be -- returned. -uploadOperationRequests :: UploadOperation -> RequestBody -> SHA256 -> Integer -> Maybe [Request] -uploadOperationRequests op content oid size = +uploadOperationRequests :: UploadOperation -> (ServerSupportsChunks -> RequestBody) -> SHA256 -> Integer -> Maybe [Request] +uploadOperationRequests op mkcontent oid size = case (mkdlreq, mkverifyreq) of (Nothing, _) -> check Nothing (Just dlreq, Nothing) -> check $ Just [dlreq] @@ -432,25 +433,40 @@ mkdlreq = mkdlreq' <$> operationParamsRequest (upload op) - mkdlreq' r = r + mkdlreq' (r, ssc) = r { method = "PUT" - , requestBody = content + , requestBody = mkcontent ssc } mkverifyreq = mkverifyreq' <$> (operationParamsRequest =<< verify op) - mkverifyreq' r = addLfsJsonHeaders $ r + mkverifyreq' (r, _ssc) = addLfsJsonHeaders $ r { method = "POST" , requestBody = RequestBodyLBS $ encode $ Verification oid size } -operationParamsRequest :: OperationParams -> Maybe Request +-- | When the LFS server indicates that it supports Transfer-Encoding chunked, +-- this will contain a true value, and the RequestBody provided to +-- uploadOperationRequests may be created using RequestBodyStreamChunked. +-- Otherwise, that should be avoided as the server may not support the +-- chunked encoding. +newtype ServerSupportsChunks = ServerSupportsChunks Bool + +operationParamsRequest :: OperationParams -> Maybe (Request, ServerSupportsChunks) operationParamsRequest ps = do r <- parseRequest (T.unpack (href ps)) let headers = map convheader $ maybe [] M.toList (header ps) - return $ r { requestHeaders = headers } + let headers' = filter allowedheader headers + let ssc = ServerSupportsChunks $ + any (== ("Transfer-Encoding", "chunked")) headers + return (r { requestHeaders = headers' }, ssc) where convheader (k, v) = (CI.mk (E.encodeUtf8 k), E.encodeUtf8 v) + -- requestHeaders is not allowed to set Transfer-Encoding or + -- Content-Length; copying those over blindly could request in a + -- malformed request. + allowedheader (k, _) = k /= "Transfer-Encoding" + && k /= "Content-Length" type Url = T.Text diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/git-lfs-1.1.2/git-lfs.cabal new/git-lfs-1.2.0/git-lfs.cabal --- old/git-lfs-1.1.2/git-lfs.cabal 2001-09-09 03:46:40.000000000 +0200 +++ new/git-lfs-1.2.0/git-lfs.cabal 2001-09-09 03:46:40.000000000 +0200 @@ -1,5 +1,5 @@ Name: git-lfs -Version: 1.1.2 +Version: 1.2.0 Cabal-Version: >= 1.10 License: AGPL-3 Maintainer: Joey Hess <[email protected]>
