<commit_before>class Bailador::Request {
    use URI::Escape;

    has $.env is rw;

    multi method params () {
        # Dancer2 also mixes GET and POST params and overwrites the GET params by the POST params
        my %ret = self.params('query');
        %ret = |%ret, self.params('body');

        return %ret;
    }
    multi method params ($source) {<commit_msg>Fallback if URI decoding as UTF-8 fails<commit_after>class Bailador::Request {

    has $.env is rw;

    sub uri_unescape ($uri) {
        use URI::Escape;
        my $decoded;
        try {
            $decoded = uri_unescape($uri);
            CATCH {
                when X::AdHoc {
                    $decoded = uri_unescape($uri, :no_utf8);
                }
            }
        }
        $decoded;
    }

    multi method params () {
        # Dancer2 also mixes GET and POST params and overwrites the GET params by the POST params
        my %ret = self.params('query');
        %ret = |%ret, self.params('body');

        return %ret;
    }
    multi method params ($source) {
{'fraction_non_alphanumeric': 0.10964083175803403, 'fraction_numerical': 0.003780718336483932, 'mean_word_length': 1.8315508021390374, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7022606', 'n_tokens_mistral': 328, 'n_tokens_neox': 312, 'n_words': 99}