comparison vendor/guzzlehttp/guzzle/src/Middleware.php @ 13:5fb285c0d0e3

Update Drupal core to 8.4.7 via Composer. Security update; I *think* we've been lucky to get away with this so far, as we don't support self-registration which seems to be used by the so-called "drupalgeddon 2" attack that 8.4.5 was vulnerable to.
author Chris Cannam
date Mon, 23 Apr 2018 09:33:26 +0100
parents 4c8ae668cc8c
children
comparison
equal deleted inserted replaced
12:7a779792577d 13:5fb285c0d0e3
32 throw new \InvalidArgumentException('cookies must be an instance of GuzzleHttp\Cookie\CookieJarInterface'); 32 throw new \InvalidArgumentException('cookies must be an instance of GuzzleHttp\Cookie\CookieJarInterface');
33 } 33 }
34 $cookieJar = $options['cookies']; 34 $cookieJar = $options['cookies'];
35 $request = $cookieJar->withCookieHeader($request); 35 $request = $cookieJar->withCookieHeader($request);
36 return $handler($request, $options) 36 return $handler($request, $options)
37 ->then(function ($response) use ($cookieJar, $request) { 37 ->then(
38 $cookieJar->extractCookies($request, $response); 38 function ($response) use ($cookieJar, $request) {
39 return $response; 39 $cookieJar->extractCookies($request, $response);
40 } 40 return $response;
41 }
41 ); 42 );
42 }; 43 };
43 }; 44 };
44 } 45 }
45 46
70 } 71 }
71 72
72 /** 73 /**
73 * Middleware that pushes history data to an ArrayAccess container. 74 * Middleware that pushes history data to an ArrayAccess container.
74 * 75 *
75 * @param array $container Container to hold the history (by reference). 76 * @param array|\ArrayAccess $container Container to hold the history (by reference).
76 * 77 *
77 * @return callable Returns a function that accepts the next handler. 78 * @return callable Returns a function that accepts the next handler.
78 * @throws \InvalidArgumentException if container is not an array or ArrayAccess. 79 * @throws \InvalidArgumentException if container is not an array or ArrayAccess.
79 */ 80 */
80 public static function history(&$container) 81 public static function history(&$container)