From add71c68e4bae37e443bff60f572cf74d35b8afe Mon Sep 17 00:00:00 2001 From: Kharec Date: Wed, 24 Dec 2025 18:48:20 +0100 Subject: [PATCH] fix: return the normalized URL from the validator in the response --- lib/Urupam/API.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/Urupam/API.pm b/lib/Urupam/API.pm index 9f02e11..fc6f629 100644 --- a/lib/Urupam/API.pm +++ b/lib/Urupam/API.pm @@ -28,9 +28,11 @@ sub shorten { return; } + my $normalized_url; $validator->validate_url_with_checks($original_url)->then( sub { my $sanitized_url = shift; + $normalized_url = $sanitized_url; return $url_service->create_short_url($sanitized_url); } )->then( @@ -42,7 +44,7 @@ sub shorten { success => 1, short_url => $short_url, short_code => $short_code, - original_url => $original_url + original_url => $normalized_url } ); }