Skip to content

Commit 71144f6

Browse files
committed
INT-192: Secure proxy endpoint
1 parent 8cc9d77 commit 71144f6

2 files changed

Lines changed: 19 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
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

src/Storefront/Controller/ProxyController.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use Symfony\Component\HttpFoundation\JsonResponse;
1616
use Symfony\Component\HttpFoundation\Request;
1717
use Symfony\Component\HttpFoundation\Response;
18+
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
1819
use 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()))

0 commit comments

Comments
 (0)