Surface destination edits as the core dynamic short-link feature.
Deploy Ladill Link / deploy (push) Successful in 1m40s
Deploy Ladill Link / deploy (push) Successful in 1m40s
Move destination editing to the top of the link page, clarify that the short URL never changes, prevent caches from pinning old redirects, and test that later destination updates take effect immediately.
This commit is contained in:
@@ -116,7 +116,11 @@ class LinkController extends Controller
|
||||
return back()->withInput()->withErrors(['destination_url' => $e->getMessage()]);
|
||||
}
|
||||
|
||||
return back()->with('success', 'Link updated.');
|
||||
$message = isset($validated['destination_url'])
|
||||
? 'Destination updated. Your short link is unchanged — new clicks go to the new URL.'
|
||||
: 'Link updated.';
|
||||
|
||||
return back()->with('success', $message);
|
||||
}
|
||||
|
||||
public function destroy(ShortLink $link): RedirectResponse
|
||||
|
||||
@@ -21,9 +21,16 @@ class LinkRedirectController extends Controller
|
||||
$link = $this->links->resolve($request, $slug);
|
||||
|
||||
if ($link !== null && $link->isDirectRedirect()) {
|
||||
// Always read the current destination from the DB so edits take effect
|
||||
// immediately. 302 + no-store so browsers/CDNs do not pin an old Location.
|
||||
$target = $link->resolveRedirectUrl($request, $path);
|
||||
|
||||
return redirect()->away($target, 302);
|
||||
return redirect()
|
||||
->away($target, 302)
|
||||
->withHeaders([
|
||||
'Cache-Control' => 'no-store, no-cache, must-revalidate, max-age=0',
|
||||
'Pragma' => 'no-cache',
|
||||
]);
|
||||
}
|
||||
|
||||
// Catalog / QR ecosystem slugs: proxy so destination stays live in the source app.
|
||||
|
||||
Reference in New Issue
Block a user