interchange / Amazon-MWS

API binding for Amazon's Marketplace Web Services.
8 stars 8 forks source link

Slash problems cause signature failure #9

Closed jordanmhiller closed 8 years ago

jordanmhiller commented 8 years ago

I was receiving "signature does not match" errors from Amazon when calling a method from the Orders API, e.g. my $response = $mws->ListOrders({ MarketplaceId => [ $MARKETPLACE_ID ], LastUpdatedAfter => DateTime->today(), });

I found that the default endpoint, 'https://mws.amazonaws.com/', is concatenated with the service URL, "/Orders/$version", resulting in a double-slash in the path: https://mws.amazonaws.com//Orders/2013-09-01

That occurs at Routines.pm line 101. The URL used for the final request as well as for calculating the signature then included that extra slash. This appears to be what caused the signature errors.

My workaround has been to override the default endpoint and set it to 'https://mws.amazonaws.com', no trailing slash, via the Amazon::MWS::Client constructor, and I haven't yet encountered any problematic side effects of this.

melmothx commented 8 years ago

Thanks for the report!