Skip to content

Instantly share code, notes, and snippets.

@semifor
Created August 26, 2009 20:50
Show Gist options
  • Save semifor/175831 to your computer and use it in GitHub Desktop.
Save semifor/175831 to your computer and use it in GitHub Desktop.
diff --git a/lib/Net/Twitter/Core.pm b/lib/Net/Twitter/Core.pm
index f52207c..3011089 100644
--- a/lib/Net/Twitter/Core.pm
+++ b/lib/Net/Twitter/Core.pm
@@ -86,7 +86,7 @@ sub _authenticated_request {
my $msg;
- $_ = encode('utf-8', $_) for values %$args;
+ $_ = encode('utf-8', $_) for keys %$args, values %$args;
if ( $http_method eq 'GET' ) {
$uri->query_form($args);
diff --git a/lib/Net/Twitter/Role/OAuth.pm b/lib/Net/Twitter/Role/OAuth.pm
index e38f999..3c6249c 100644
--- a/lib/Net/Twitter/Role/OAuth.pm
+++ b/lib/Net/Twitter/Role/OAuth.pm
@@ -181,7 +181,7 @@ override _authenticated_request => sub {
}
elsif ( $http_method eq 'POST' ) {
delete $args->{source}; # not necessary with OAuth requests
- $_ = encode('utf-8', $_) for values %$args;
+ $_ = encode('utf-8', $_) for keys %$args, values %$args;
$msg = POST($uri, $args);
}
else {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment