File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed
src/Elasticsearch.Net/Connection Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -146,7 +146,8 @@ public virtual ElasticsearchResponse<TReturn> Request<TReturn>(RequestData reque
146146 builder . StatusCode = ( int ) response . StatusCode ;
147147 builder . Stream = response . GetResponseStream ( ) ;
148148
149- builder . DeprecationWarnings = response . Headers . GetValues ( "Warning" ) ;
149+ if ( response . SupportsHeaders && response . Headers . HasKeys ( ) && response . Headers . AllKeys . Contains ( "Warning" ) )
150+ builder . DeprecationWarnings = response . Headers . GetValues ( "Warning" ) ;
150151 // https://github.com/elastic/elasticsearch-net/issues/2311
151152 // if stream is null call dispose on response instead.
152153 if ( builder . Stream == null || builder . Stream == Stream . Null ) response . Dispose ( ) ;
You can’t perform that action at this time.
0 commit comments