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 @@ -162,7 +162,8 @@ public virtual ElasticsearchResponse<TReturn> Request<TReturn>(RequestData reque
162162 builder . StatusCode = ( int ) response . StatusCode ;
163163 builder . Stream = response . GetResponseStream ( ) ;
164164
165- if ( response . SupportsHeaders && response . Headers . HasKeys ( ) && response . Headers . AllKeys . Contains ( "Warning" ) )
165+ //response.Headers.HasKeys() can return false even if response.Headers.AllKeys has values.
166+ if ( response . SupportsHeaders && response . Headers . Count > 0 && response . Headers . AllKeys . Contains ( "Warning" ) )
166167 builder . DeprecationWarnings = response . Headers . GetValues ( "Warning" ) ;
167168 // https://github.com/elastic/elasticsearch-net/issues/2311
168169 // if stream is null call dispose on response instead.
You can’t perform that action at this time.
0 commit comments