Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added uri escaped query replacement, fixed load test impossibility

  • Loading branch information...
commit efdd86b1a6a9f2f4c7e5c180ea55b75a6897eefe 1 parent b42c356
Torsten Raudssus Getty authored
Showing with 6 additions and 2 deletions.
  1. +1 −1  dist.ini
  2. +4 −0 lib/App/DuckPAN/Web.pm
  3. +1 −1  t/00-load.t
2  dist.ini
View
@@ -56,7 +56,7 @@ MooX::HasEnv = 0
Parse::CPAN::Packages::Fast = 0.04
Plack = 0.9986
Term::UI = 0.30
-URL::Encode = 0.01
+URI = 1.60
utf8::all = 0.004
version = 0.96
4 lib/App/DuckPAN/Web.pm
View
@@ -10,6 +10,7 @@ use Data::Printer;
use IO::All -utf8;
use HTTP::Request;
use LWP::UserAgent;
+use URI::Escape;
has blocks => ( is => 'ro', required => 1 );
has page_root => ( is => 'ro', required => 1 );
@@ -118,7 +119,10 @@ sub request {
last if $result;
}
my $page = $self->page_spice;
+ my $uri_encoded_query = uri_escape($query);
+ my $uri_encoded_ddh = uri_escape('duckduckhack-template-for-spice');
$page =~ s/duckduckhack-template-for-spice/$query/g;
+ $page =~ s/$uri_encoded_ddh/$uri_encoded_query/g;
if ($result) {
p($result);
my $call_extf = $result->caller->module_share_dir.'/spice.js';
2  t/00-load.t
View
@@ -5,6 +5,6 @@ use warnings;
use Test::LoadAllModules;
BEGIN {
- all_uses_ok( search_path => 'App::DuckPAN' );
+ all_uses_ok( search_path => 'App::DuckPAN', except => [ 'App::DuckPAN::Web' ] );
}
Please sign in to comment.
Something went wrong with that request. Please try again.