Skip to content

Commit

Permalink
libgit2: enforce timeouts for http transports
Browse files Browse the repository at this point in the history
Attach context to HTTP requests at the transport level to honour
timeouts.

Signed-off-by: Sanskar Jaiswal <jaiswalsanskar078@gmail.com>
  • Loading branch information
aryan9600 committed Jul 8, 2022
1 parent f9fdcc7 commit b7133d7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions pkg/git/libgit2/managed/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,7 @@ func (self *httpSmartSubtransportStream) sendRequest() error {
URL: self.req.URL,
Header: self.req.Header,
}
req = req.WithContext(self.owner.ctx)

if req.Method == "POST" {
if len(content) == 0 {
Expand Down

0 comments on commit b7133d7

Please sign in to comment.