Skip to content

Commit

Permalink
Try disabling chunked encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew Barnes committed Nov 7, 2023
1 parent e91e932 commit bdebf21
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion pkg/util/graph/adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,15 @@ type GraphRequestAdapter struct {
core.GraphRequestAdapterBase
}

type AddHeaderTransport struct {
Transport http.RoundTripper
}

func (t AddHeaderTransport) RoundTrip(req *http.Request) (*http.Response, error) {
req.TransferEncoding = []string{"identity"}
return t.Transport.RoundTrip(req)
}

// NewGraphRequestAdapter creates a new GraphRequestAdapter with the given parameters
// Parameters:
// authenticationProvider: the provider used to authenticate requests
Expand All @@ -32,7 +41,9 @@ type GraphRequestAdapter struct {
func NewGraphRequestAdapter(authenticationProvider absauth.AuthenticationProvider) (*GraphRequestAdapter, error) {
httpClient := kiotahttp.GetDefaultClient()
httpClient.Transport = &loghttp.Transport{
Transport: httpClient.Transport,
Transport: AddHeaderTransport{
Transport: httpClient.Transport,
},
LogRequest: func(req *http.Request) {
data, _ := httputil.DumpRequestOut(req, true)
log.Writer().Write(data)
Expand Down

0 comments on commit bdebf21

Please sign in to comment.