Skip to content

Commit 70bfa2e

Browse files
committed
Change Server to allow resource path to come from Slug header.
1 parent 7f28ab3 commit 70bfa2e

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/Server.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,12 @@ final public function respondToRequest(Request $request): Response
103103
}
104104
$path = rawurldecode($path);
105105

106-
// @FIXME: The path can also come from a 'Slug' header
106+
// The path can also come from a 'Slug' header
107+
if ($path === '' && $request->hasHeader('Slug')) {
108+
$slugs = $request->getHeader('Slug');
109+
// @CHECKME: First set header wins, is this correct? Or should it be the last one?
110+
$path = reset($slugs);
111+
}
107112

108113
$method = $this->getRequestMethod($request);
109114

0 commit comments

Comments
 (0)