Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

graph: Allow gzip compression in requests #3278

Merged
merged 1 commit into from
Nov 27, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading