mirkokiefer / aws-lib

Extensible Node.js library for the Amazon Web Services API
MIT License
681 stars 166 forks source link

Setting "region" does not work #39

Closed Prinzhorn closed 12 years ago

Prinzhorn commented 12 years ago

I'm setting the "region" option to "DE" like this

var amz = aws.createProdAdvClient(/*...*/);

amz.call('ItemLookup', {ItemId: 'foobar', host: 'ecs.amazonaws.de', region: 'DE'}, function(result) {
    console.log(JSON.stringify(result, null, 4));
});

and I expect the request being sent to Amazon to look like this

ItemId=foobar&host=ecs.amazonaws.de&Region=DE

but what actually happens is

ItemId=foobar&host=ecs.amazonaws.de&region=DE&Region=US

I'm already investigating where the key gets lowercased, but maybe someone can help. It's very confusing, because in prodAdv.js it is still uppercased.

query["Region"] = obj.region
Prinzhorn commented 12 years ago

Never mind, after opening the issue I found out that I have to set the options in createProdAdvClient and not in the call method. Or if I want to set it using the call method, it needs to be upper cased.