Skip to content

How to fix compressed Aggregates response? #1900

Answered by MSeifAllah
LukasSefcik asked this question in Q&A
Discussion options

You must be logged in to vote

@LukasSefcik @philproctor ,
I had the problem . You have the problem because the responses from Routes are
compressed ( Content-Encoding : gzip )

to fixed it you have two solutions :

  • add a delegate to your aggregator and add
protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
{
    request.Headers.AcceptEncoding.Clear();
    request.Headers.AcceptEncoding.Add(new StringWithQualityHeaderValue("deflate"));
    request.Headers.AcceptEncoding.Add( new StringWithQualityHeaderValue("utf-8"));
    request.Headers.AcceptEncoding.Add(new StringWithQualityHeaderValue("br"));
    return await base.SendAsync(request, cancella…

Replies: 5 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@raman-m
Comment options

Answer selected by raman-m
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@raman-m
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
Aggregation Ocelot feature: Request Aggregation
7 participants
Converted from issue

This discussion was converted from issue #716 on January 07, 2024 15:10.