Skip to content

Commit

Permalink
graph: Allow gzip compression in requests
Browse files Browse the repository at this point in the history
Microsoft fixed the Graph service regression that broke
kiota-http-go, so revert the workaround.
  • Loading branch information
Matthew Barnes committed Nov 20, 2023
1 parent e7f5140 commit c5bee45
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions pkg/util/graph/adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,7 @@ func (t *DebugTransport) RoundTrip(req *http.Request) (*http.Response, error) {
// Returns:
// a new GraphRequestAdapter
func NewGraphRequestAdapter(authenticationProvider absauth.AuthenticationProvider) (*GraphRequestAdapter, error) {
// XXX Temporary workaround for IcM Incident 439391116:
// The Graph service is not handling gzipped requests properly but Kiota's HTTP client gzips by default.
// This middleware list is equivalent to kiotahttp.GetDefaultMiddlewares, minus the CompressionHandler.
middlewares := []kiotahttp.Middleware{
kiotahttp.NewRetryHandler(),
kiotahttp.NewRedirectHandler(),
kiotahttp.NewParametersNameDecodingHandler(),
kiotahttp.NewUserAgentHandler(),
}

httpClient := kiotahttp.GetDefaultClient(middlewares...)
httpClient := kiotahttp.GetDefaultClient()
if _, doTrace := os.LookupEnv(ENV_DEBUG_TRACE); doTrace {
httpClient.Transport = &DebugTransport{Transport: httpClient.Transport}
}
Expand Down

0 comments on commit c5bee45

Please sign in to comment.