Browse Source

Bug fix for missing uri_escape of a key in _build_multiget_uri.

Bosko Devetak 4 years ago
parent
commit
f8ebfe441c
3 changed files with 10 additions and 5 deletions
  1. 5 0
      Changes
  2. 2 2
      lib/HBase/JSONRest.pm
  3. 3 3
      t/uri_gen.t

+ 5 - 0
Changes

@ -46,3 +46,8 @@ Revision history for HBase-JSONRest
46 46
        - POD for put with HBase timestamp override
47 47
        - POD for delete (Robert Nilsson)
48 48
49
0.021   Date/time: 2015-04-16
50
51
        [BUG FIXES]
52
        - Bug fix for missing uri_escape of a key in _build_multiget_uri.
53

+ 2 - 2
lib/HBase/JSONRest.pm

@ -523,10 +523,10 @@ sub _build_multiget_uri {
523 523
    my $current_url = undef;
524 524
    foreach my $key (@$keys) {
525 525
        if (! defined $current_url) {
526
            $current_url ||= $uri_base . "row=" . $key;
526
            $current_url ||= $uri_base . "row=" . uri_escape($key);
527 527
        }
528 528
        else{
529
            my $next_url = $current_url . '&row=' . $key;
529
            my $next_url = $current_url . '&row=' . uri_escape($key);
530 530
            if (length($next_url) < 2000) {
531 531
                $current_url = $next_url;
532 532
            }

+ 3 - 3
t/uri_gen.t

@ -108,14 +108,14 @@ ok(
108 108
        'table' => 'my_table',
109 109
        'where' => {
110 110
            'key_in' => [
111
                1234567890,
111
                '12;34567890',
112 112
                1234567891,
113 113
                1234567892,
114
                1234567893,
114
                '12345678;93',
115 115
                1234567894,
116 116
            ]
117 117
        },
118
    })->[0]->{url} eq q|/my_table/multiget?row=1234567890&row=1234567891&row=1234567892&row=1234567893&row=1234567894|
118
    })->[0]->{url} eq q|/my_table/multiget?row=12%3B34567890&row=1234567891&row=1234567892&row=12345678%3B93&row=1234567894|
119 119
    ,
120 120
    q|Test simple multiget|
121 121
);