Skip to content

Commit

Permalink
UHF-4799: use str comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
rpnykanen committed Mar 16, 2022
1 parent 94d52ea commit 5475bd7
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/HttpMiddleware/AssetHttpMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,10 @@ private function isJsonResponse(Response $response) : bool {
* TRUE if response is XML
*/
private function isXmlResponse(Response $response){
$contentTypes = [
'application/xml',
'application/xml; charset=utf-8'
];
return in_array($response->headers->get('content-type'), $contentTypes);
return str_starts_with(
strtolower($response->headers->get('content-type')),
'application/xml'
);
}

/**
Expand Down

0 comments on commit 5475bd7

Please sign in to comment.