File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -208,11 +208,16 @@ private void EnsureMediaTypeEqual(string newMediaType)
208208 /// <returns></returns>
209209 public string GetHeadersString ( )
210210 {
211+ const string host = "Host" ;
211212 var builder = new StringBuilder ( )
212- . AppendLine ( $ "{ this . Method } { this . RequestUri . PathAndQuery } HTTP/{ this . Version } ")
213- . AppendLine ( $ "Host: { this . RequestUri . Authority } ")
214- . Append ( this . Headers . ToString ( ) ) ;
213+ . AppendLine ( $ "{ this . Method } { this . RequestUri . PathAndQuery } HTTP/{ this . Version } ") ;
215214
215+ if ( this . Headers . Contains ( host ) == false )
216+ {
217+ builder . AppendLine ( $ "{ host } : { this . RequestUri . Authority } ") ;
218+ }
219+
220+ builder . Append ( this . Headers . ToString ( ) ) ;
216221 if ( this . Content != null )
217222 {
218223 builder . Append ( this . Content . Headers . ToString ( ) ) ;
You can’t perform that action at this time.
0 commit comments