Fixed regex.
This commit is contained in:
parent
b45fee1b7e
commit
717d7c97eb
1 changed files with 4 additions and 4 deletions
|
@ -22,12 +22,12 @@ class UploadsRoutes implements IRouteHandler {
|
|||
HandlerAttribute::register($router, $this);
|
||||
} else {
|
||||
$router->options('/', $this->getUpload(...));
|
||||
$router->get('/([A-Za-z0-9]+)(?:\.(t))?', $this->getUpload(...));
|
||||
$router->get('/([A-Za-z0-9\-_]+)(?:\.(t))?', $this->getUpload(...));
|
||||
}
|
||||
}
|
||||
|
||||
#[HttpOptions('/uploads/([A-Za-z0-9]+)(?:\.(t|json))?')]
|
||||
#[HttpGet('/uploads/([A-Za-z0-9]+)(?:\.(t|json))?')]
|
||||
#[HttpOptions('/uploads/([A-Za-z0-9\-_]+)(?:\.(t|json))?')]
|
||||
#[HttpGet('/uploads/([A-Za-z0-9\-_]+)(?:\.(t|json))?')]
|
||||
public function getUpload($response, $request, string $fileId, string $fileExt = '') {
|
||||
if($this->isApiDomain) {
|
||||
if($request->hasHeader('Origin'))
|
||||
|
@ -187,7 +187,7 @@ class UploadsRoutes implements IRouteHandler {
|
|||
return $this->uploadsCtx->convertToClientJsonV1($uploadInfo);
|
||||
}
|
||||
|
||||
#[HttpDelete('/uploads/([A-Za-z0-9]+)')]
|
||||
#[HttpDelete('/uploads/([A-Za-z0-9\-_]+)')]
|
||||
public function deleteUpload($response, $request, string $fileId) {
|
||||
if($request->hasHeader('Origin'))
|
||||
$response->setHeader('Access-Control-Allow-Credentials', 'true');
|
||||
|
|
Loading…
Reference in a new issue