Skip to content

Commit

Permalink
raw response condition update for svg to preview svg
Browse files Browse the repository at this point in the history
  • Loading branch information
shamsbd71 authored Feb 10, 2020
1 parent 2ce6fc2 commit 9ea0cad
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ public static function JSON($data, $code=200)
*/
public static function RAW($mime, $content, $response=200)
{
if(!$mime){
if(substr($content, 0, 4) === "<svg"){
$mime = 'image/svg+xml';
}
}
header('Content-Type: ' . $mime);
http_response_code($response);
print $content;
Expand Down

0 comments on commit 9ea0cad

Please sign in to comment.