Browse Source

Use URI::Escape instead of CGI.

Bosko Devetak 5 years ago
parent
commit
c570de17b2
1 changed files with 5 additions and 5 deletions
  1. 5 5
      lib/HBase/JSONRest.pm

+ 5 - 5
lib/HBase/JSONRest.pm

@ -7,7 +7,7 @@ use 5.010;
7 7
8 8
use HTTP::Tiny;
9 9
10
use CGI qw(escape);
10
use URI::Escape;
11 11
12 12
use MIME::Base64;
13 13
use JSON::XS qw(decode_json encode_json);
@ -16,7 +16,7 @@ use Time::HiRes qw(gettimeofday time);
16 16
17 17
use Data::Dumper;
18 18
19
use DEBUG(0);
19
our $VERSION = "0.1";
20 20
21 21
my %INFO_ROUTES = (
22 22
    version => '/version',
@ -146,11 +146,11 @@ sub _get_tiny {
146 146
    my $route;
147 147
    if ($query->{where}->{key_equals}) {
148 148
        my $key = $query->{where}->{key_equals};
149
        $route = '/' . $table . '/' . escape($key);
149
        $route = '/' . $table . '/' . uri_escape($key);
150 150
    }
151 151
    else {
152 152
        my $part_of_key = $query->{where}->{key_begins_with};
153
        $route = '/' . $table . '/' . escape($part_of_key . '*');
153
        $route = '/' . $table . '/' . uri_escape($part_of_key . '*');
154 154
    }
155 155
156 156
    my $uri = $self->{service} . $route;
@ -287,7 +287,7 @@ sub put {
287 287
    $JSON_Command .= join(",", @sorted_json_row_changes);
288 288
    $JSON_Command .= ']}';
289 289
290
    my $route = '/' . escape($table) . '/false-row-key';
290
    my $route = '/' . uri_escape($table) . '/false-row-key';
291 291
    my $uri = $self->{service} . $route;
292 292
293 293
    my $http = HTTP::Tiny->new();