Skip to content

Commit 5d3ed63

Browse files
oleksandr-ncbackportbot[bot]
authored andcommitted
fix(proxy): match route URL against request path including leading slash (HaRP alignment)
Signed-off-by: Oleksander Piskun <oleksandr2088@icloud.com>
1 parent dfdd5ba commit 5d3ed63

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

lib/Controller/ExAppProxyController.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,8 @@ private function buildMultipartFormData(array $bodyParams, array $files): array
317317
}
318318

319319
private function passesExAppProxyRoutesChecks(ExApp $exApp, string $exAppRoute): array {
320+
// Route URL is a regex matched against the request path including its leading slash, mirroring HaRP's target_path semantics.
321+
$exAppRoute = '/' . $exAppRoute;
320322
foreach ($exApp->getRoutes() as $route) {
321323
$pattern = '~^(?:' . str_replace('~', '\\~', $route['url']) . ')~i';
322324
if (preg_match($pattern, $exAppRoute) === 1

0 commit comments

Comments
 (0)