File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
src/Elasticsearch/Connections Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -283,6 +283,9 @@ private function wrapHandler(callable $handler): callable
283
283
} else {
284
284
$ connection ->markAlive ();
285
285
286
+ if (isset ($ response ['headers ' ]['Warning ' ])) {
287
+ $ this ->logWarning ($ request , $ response );
288
+ }
286
289
if (isset ($ response ['body ' ]) === true ) {
287
290
$ response ['body ' ] = stream_get_contents ($ response ['body ' ]);
288
291
$ this ->lastRequest ['response ' ]['body ' ] = $ response ['body ' ];
@@ -342,6 +345,11 @@ public function getHeaders(): array
342
345
return $ this ->headers ;
343
346
}
344
347
348
+ public function logWarning (array $ request , array $ response ): void
349
+ {
350
+ $ this ->log ->warning ('Deprecation ' , $ response ['headers ' ]['Warning ' ]);
351
+ }
352
+
345
353
/**
346
354
* Log a successful request
347
355
*
You can’t perform that action at this time.
0 commit comments