Add two modes for short URLs

This commit is contained in:
Alejandro Celaya
2023-01-25 20:33:07 +01:00
parent 87007677ed
commit 05acd4ae88
15 changed files with 68 additions and 17 deletions

View File

@@ -25,6 +25,6 @@ class CreateShortUrlAction extends AbstractCreateShortUrlAction
$payload[ShortUrlInputFilter::API_KEY] = AuthenticationMiddleware::apiKeyFromRequest($request);
$payload[EnvVars::MULTI_SEGMENT_SLUGS_ENABLED->value] = $this->urlShortenerOptions->multiSegmentSlugsEnabled;
return ShortUrlCreation::fromRawData($payload);
return ShortUrlCreation::fromRawData($payload, $this->urlShortenerOptions->mode);
}
}

View File

@@ -25,6 +25,6 @@ class SingleStepCreateShortUrlAction extends AbstractCreateShortUrlAction
ShortUrlInputFilter::API_KEY => $apiKey,
// This will usually be null, unless this API key enforces one specific domain
ShortUrlInputFilter::DOMAIN => $request->getAttribute(ShortUrlInputFilter::DOMAIN),
]);
], $this->urlShortenerOptions->mode);
}
}