diff options
author | Andinus <andinus@nand.sh> | 2020-06-30 13:38:39 +0530 |
---|---|---|
committer | Andinus <andinus@nand.sh> | 2020-06-30 13:38:39 +0530 |
commit | 10f63e16f6e78e453a07e221ac74ce3226ea3a9e (patch) | |
tree | cb119e64fbf515e916bc7d18748b77a4d0cadc6b /lib | |
parent | 774b5d822adb7d0d05ea41d0c85f71a2e6bd07fd (diff) | |
download | crux-10f63e16f6e78e453a07e221ac74ce3226ea3a9e.tar.gz |
Remove URI::Encode dependency, fix $url encoding
Looks like query_keywords encodes the url itself so $url was being double-encoded. Also, next time use URI::Escape instead - looks better.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/UnsplashSource.pm | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/UnsplashSource.pm b/lib/UnsplashSource.pm index c41960e..bcce966 100644 --- a/lib/UnsplashSource.pm +++ b/lib/UnsplashSource.pm @@ -8,7 +8,6 @@ use warnings; use URI; use HTTP::Tiny; use Carp qw( croak carp ); -use URI::Encode qw( uri_encode ); my $api = "https://source.unsplash.com"; my $http = HTTP::Tiny->new( @@ -52,7 +51,7 @@ sub random_search { push @segments, $options{resolution}; $url->path_segments( @segments ); - $url->query_keywords( uri_encode(join(',', @{$options{search}})) ); + $url->query_keywords( join(',', @{$options{search}}) ); return $http->head($url); } @@ -93,7 +92,7 @@ sub fixed { push @segments, "weekly" if $options{weekly}; $url->path_segments( @segments ); - $url->query_keywords( uri_encode(join(',', @{$options{search}})) ); + $url->query_keywords( join(',', @{$options{search}}) ); return $http->head($url); } |