Skip to content

Commit

Permalink
[MI-2877]: Review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
avas27JTG committed Mar 13, 2023
1 parent 2c7bf28 commit f53bbd3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion server/constants/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ const (

DialogFieldNameComment = "comment"

MaxBytesSizeForReadingClientBody = 1000000
MaxBytesSizeForReadingResponseBody = 1000000
)

var (
Expand Down
4 changes: 2 additions & 2 deletions server/plugin/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -497,9 +497,9 @@ func (c *client) makeHTTPRequest(req *http.Request, contentType string, out inte
}
defer resp.Body.Close()

// Limit client bodies to 1 MB or 1000 KB
// Limit reading the response bodies to 1 MB or 1000 KB
// This is ideal for the responses returned by Azure DevOps APIs used here
resp.Body = http.MaxBytesReader(nil, resp.Body, constants.MaxBytesSizeForReadingClientBody)
resp.Body = http.MaxBytesReader(nil, resp.Body, constants.MaxBytesSizeForReadingResponseBody)

responseData, err = io.ReadAll(resp.Body)
if err != nil {
Expand Down

0 comments on commit f53bbd3

Please sign in to comment.