Commit 68c51b73 authored by catch's avatar catch
Browse files

Issue #3301288 by balintpekker, mondrake, mglaman: Deprecated getStatus() in DrupalTestBrowser

parent c731970d
Loading
Loading
Loading
Loading
+0 −24
Original line number Diff line number Diff line
@@ -239,28 +239,4 @@ protected function createResponse(ResponseInterface $response) {
    return new Response((string) $response->getBody(), $response->getStatusCode(), $response->getHeaders());
  }

  /**
   * Reads response meta tags to guess content-type charset.
   *
   * @param \Symfony\Component\BrowserKit\Response $response
   *   The origin response to filter.
   *
   * @return \Symfony\Component\BrowserKit\Response
   *   A BrowserKit Response instance.
   */
  protected function filterResponse($response) {
    $content_type = $response->getHeader('Content-Type');

    if (!$content_type || strpos($content_type, 'charset=') === FALSE) {
      if (preg_match('/\<meta[^\>]+charset *= *["\']?([a-zA-Z\-0-9]+)/i', $response->getContent(), $matches)) {
        $headers = $response->getHeaders();
        $headers['Content-Type'] = $content_type . ';charset=' . $matches[1];

        $response = new Response($response->getContent(), $response->getStatus(), $headers);
      }
    }

    return parent::filterResponse($response);
  }

}