Use static types to troubleshoot the Libarchive/POST body thing...

This commit is contained in:
swagg boi 2023-10-31 21:54:43 -04:00
parent 2c2a196171
commit 2f440817c4

View file

@ -24,19 +24,19 @@ $router.get(-> $request, $response {
});
$router.post(-> $request, $response {
my $return-url = $request.content.{'hyperlink'};
my $url-scheme = $request.headers.{'X-Forwarded-Proto'} || 'http';
my $url-host = $request.headers.{'Host'};
my $base-url = $url-scheme ~ '://' ~ $url-host ~ '/';
my $hyperlink = $base-url ~ encode-base64(gzip($return-url), :str);
my Str $return-url = $request.content.{'hyperlink'};
my Str $url-scheme = $request.headers.{'X-Forwarded-Proto'} || 'http';
my Str $url-host = $request.headers.{'Host'};
my Str $base-url = $url-scheme ~ '://' ~ $url-host ~ '/';
my Str $hyperlink = $base-url ~ encode-base64(gzip($return-url), :str);
$response.html($templates.process: 'index', :$hyperlink);
});
# Try a wildcard to catch 'all' path
$router.get('/**', -> $request, $response {
my $return-url = $request.path.substr(1); # Omits the leading slash
my $redirect-url = gunzip(decode-base64($return-url, :bin));
my Str $return-url = $request.path.substr(1); # Omits the leading slash
my Str $redirect-url = gunzip(decode-base64($return-url, :bin));
$response.redirect($redirect-url);
});