Skip to content

Commit

Permalink
Disable compression on httpclient transport
Browse files Browse the repository at this point in the history
  • Loading branch information
bennerv committed Nov 8, 2023
1 parent 8496c2e commit 8f34319
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pkg/util/graph/adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"log"
"net/http"
"net/http/httputil"
"os"

absauth "github.com/microsoft/kiota-abstractions-go/authentication"
kiotahttp "github.com/microsoft/kiota-http-go"
Expand Down Expand Up @@ -54,9 +53,12 @@ func (t *DebugTransport) RoundTrip(req *http.Request) (*http.Response, error) {
// a new GraphRequestAdapter
func NewGraphRequestAdapter(authenticationProvider absauth.AuthenticationProvider) (*GraphRequestAdapter, error) {
httpClient := kiotahttp.GetDefaultClient()
if _, doTrace := os.LookupEnv(ENV_DEBUG_TRACE); doTrace {
httpClient.Transport = &DebugTransport{Transport: httpClient.Transport}
httpClient.Transport = &http.Transport{
DisableCompression: true,
}

httpClient.Transport = &DebugTransport{Transport: httpClient.Transport}

baseAdapter, err := core.NewGraphRequestAdapterBaseWithParseNodeFactoryAndSerializationWriterFactoryAndHttpClient(authenticationProvider, clientOptions, nil, nil, httpClient)
if err != nil {
return nil, err
Expand Down

0 comments on commit 8f34319

Please sign in to comment.