Skip to content

Commit

Permalink
IBX-1572: Set proper mimeType of default profile image in user menu (#32
Browse files Browse the repository at this point in the history
)
  • Loading branch information
Nattfarinn authored Feb 4, 2022
1 parent b77dc08 commit b212f26
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/bundle/Controller/DefaultProfileImageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,14 @@ public function initialsAction(Request $request): Response
$initials = substr($request->query->get('initials', ''), 0, 2);
$colors = $this->getInitialsColors($initials);

$response = new Response();
$response->headers->set('Content-Type', 'image/svg+xml');

return $this->render('@IbexaUser/profile_image/initials.svg.twig', [
'initials' => $initials,
'text' => $colors['text'],
'background' => $colors['background'],
]);
], $response);
}

private function getInitialsColors(string $initials): array
Expand Down

0 comments on commit b212f26

Please # to comment.