apply uri_with() patch from Daisuke Murase
[catagits/Catalyst-Runtime.git] / lib / Catalyst / Request.pm
index 763c3ef..50886c0 100644 (file)
@@ -6,6 +6,8 @@ use base 'Class::Accessor::Fast';
 use IO::Socket qw[AF_INET inet_aton];
 use Carp;
 use utf8;
+use URI::http;
+use URI::https;
 use URI::QueryParam;
 
 __PACKAGE__->mk_accessors(
@@ -401,6 +403,8 @@ Returns the protocol (HTTP/1.0 or HTTP/1.1) used for the current request.
 
 =head2 $req->query_parameters
 
+=head2 $req->query_params
+
 Returns a reference to a hash containing query string (GET) parameters. Values can
 be either a scalar or an arrayref containing scalars.
 
@@ -535,7 +539,7 @@ sub uri_with {
         next unless defined $value;
         for ( ref $value eq 'ARRAY' ? @$value : $value ) {
             $_ = "$_";
-            utf8::encode( $_ );
+            utf8::encode( $_ ) if utf8::is_utf8($_);
         }
     };