Skip to content

Loading…

fixed: Wide character in HTTP request (bytes required) When DateTime set non Ascii locale. #15

Open
wants to merge 1 commit into from

1 participant

@hikaruy

Hi.

When DateTime is set non Ascii locale, httpdate is bad format.
Wide character in HTTP request (bytes required) .

here's fix.

regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 29, 2013
  1. @hikaruy
Showing with 3 additions and 1 deletion.
  1. +1 −0 Makefile.PL
  2. +2 −1 lib/Net/Amazon/DynamoDB.pm
View
1 Makefile.PL 100644 → 100755
@@ -21,6 +21,7 @@ WriteMakefile(
'DateTime::Format::Strptime' => 0,
'DateTime::TimeZone' => 0,
'DateTime::TimeZone::Local' => 0,
+ 'HTTP::Date' => 0,
'Digest::SHA' => 0,
'HTTP::Request' => 0,
'JSON' => 0,
View
3 lib/Net/Amazon/DynamoDB.pm 100644 → 100755
@@ -72,6 +72,7 @@ use Data::Dumper;
use DateTime::Format::HTTP;
use DateTime::Format::Strptime;
use DateTime;
+use HTTP::Date qw/ time2str /;
use Digest::SHA qw/ sha1_hex sha256_hex sha384_hex sha256 hmac_sha256_base64 /;
use HTTP::Request;
use JSON;
@@ -2066,7 +2067,7 @@ sub request {
$json = $self->json->encode( $json ) if ref $json;
# get date
- my $http_date = DateTime::Format::HTTP->format_datetime( DateTime->now );
+ my $http_date = time2str( time );
# build signable content
#$json is already utf8 encoded via json encode
Something went wrong with that request. Please try again.