File tree 1 file changed +7
-1
lines changed
1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -139,7 +139,13 @@ private HttpResponse PostPutInternal(string method)
139
139
140
140
partial void AddSyncHeaderActions ( )
141
141
{
142
- this . restrictedHeaderActions . Add ( "Connection" , ( r , v ) => r . Connection = v ) ;
142
+ //this.restrictedHeaderActions.Add("Connection", (r, v) => r.Connection = v);
143
+ this . restrictedHeaderActions . Add ( "Connection" , ( r , v ) => {
144
+ if ( v . ToLower ( ) . Contains ( "keep-alive" ) )
145
+ r . KeepAlive = true ; //if a user sets the connection header explicitly to "keep-alive" then we set the field on HttpWebRequest
146
+ else
147
+ r . KeepAlive = false ; //if "Connection" is specified as anything else, we turn off keep alive functions
148
+ } ) ;
143
149
this . restrictedHeaderActions . Add ( "Content-Length" , ( r , v ) => r . ContentLength = Convert . ToInt64 ( v ) ) ;
144
150
this . restrictedHeaderActions . Add ( "Expect" , ( r , v ) => r . Expect = v ) ;
145
151
this . restrictedHeaderActions . Add ( "If-Modified-Since" , ( r , v ) => r . IfModifiedSince = Convert . ToDateTime ( v ) ) ;
You can’t perform that action at this time.
0 commit comments