Skip to content

Commit

Permalink
fix(Request): Clear default accept headers on instantiation
Browse files Browse the repository at this point in the history
  • Loading branch information
mediumTaj committed Apr 30, 2019
1 parent 057c168 commit 24dc6ca
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/IBM.Cloud.SDK.Core/Http/Request.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ public Request(HttpRequestMessage message, MediaTypeFormatterCollection formatte
this.Formatters = formatters;
this.Dispatch = new Lazy<Task<HttpResponseMessage>>(() => dispatcher(this));
this.Filters = filters;
this.Message.Headers.Accept.Clear();
}

public IRequest WithBody<T>(T body, MediaTypeHeaderValue contentType = null)
Expand All @@ -71,10 +72,6 @@ public IRequest WithBodyContent(HttpContent body)

public IRequest WithHeader(string key, string value)
{
if (key == "Accept" && value.StartsWith("audio/", StringComparison.OrdinalIgnoreCase))
{
this.Message.Headers.Accept.Clear();
}
this.Message.Headers.TryAddWithoutValidation(key, value);
return this;
}
Expand Down

0 comments on commit 24dc6ca

Please sign in to comment.