File tree Expand file tree Collapse file tree
src/Storefront/Controller Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11# Changelog
2+ ## Unreleased
3+ ### Fix
4+ - Secure proxy endpoint
5+
26## [ v5.4.0] - 2025.03.05
37### Add
48- Add possibility to disable Web Components integration per sales channel
Original file line number Diff line number Diff line change 1515use Symfony \Component \HttpFoundation \JsonResponse ;
1616use Symfony \Component \HttpFoundation \Request ;
1717use Symfony \Component \HttpFoundation \Response ;
18+ use Symfony \Component \HttpKernel \Exception \NotFoundHttpException ;
1819use Symfony \Component \Routing \Annotation \Route ;
1920
2021/**
@@ -46,6 +47,20 @@ public function execute(
4647 ClientBuilder $ clientBuilder ,
4748 EventDispatcherInterface $ eventDispatcher ,
4849 ): Response {
50+ if (!$ this ->config ->isProxyEnabled ()) {
51+ throw new NotFoundHttpException ('Proxy is disabled. ' );
52+ }
53+
54+ // $ffo = $request->headers->get('_ffo');
55+ // $fft = $request->headers->get('_fft');
56+ //
57+ // if (!$ffo || !$fft) {
58+ // return new JsonResponse(
59+ // ['message' => 'UNAUTHORIZED'],
60+ // Response::HTTP_UNAUTHORIZED
61+ // );
62+ // }
63+
4964 $ client = $ clientBuilder
5065 ->withServerUrl ($ this ->config ->getServerUrl ())
5166 ->withCredentials (new Credentials (...$ this ->config ->getCredentials ()))
You can’t perform that action at this time.
0 commit comments