Skip to content
This repository was archived by the owner on Dec 24, 2022. It is now read-only.

Commit 8b06357

Browse files
committed
override accept or consistent behavior
1 parent 7120248 commit 8b06357

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/ServiceStack.Text/HttpUtils.HttpClient.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1086,7 +1086,10 @@ public static HttpRequestMessage With(this HttpRequestMessage httpReq, Action<Ht
10861086
var headers = config.Headers;
10871087

10881088
if (config.Accept != null)
1089-
headers.Add(new(HttpHeaders.Accept, config.Accept));
1089+
{
1090+
httpReq.Headers.Accept.Clear(); //override or consistent behavior
1091+
httpReq.Headers.Accept.Add(new(config.Accept));
1092+
}
10901093
if (config.UserAgent != null)
10911094
headers.Add(new(HttpHeaders.UserAgent, config.UserAgent));
10921095
if (config.ContentType != null)

0 commit comments

Comments
 (0)