dmcquay / node-apac

node-apac - Node.js client for the Amazon Product Advertising API, including support of Request Signatures
MIT License
499 stars 111 forks source link

Returned URLs seem to be incorrectly URL-encoded #7

Closed aseemk closed 8 years ago

aseemk commented 13 years ago

Hey there,

Great work on the library! It makes working with the Product Advertising API so much nicer than by hand! Thanks. =)

I'm seeing one small bug: returned item URLs seem to be incorrectly URL-encoded. Here's an example, in CoffeeScript:

args =
    ItemId: 'B001I8FCGK'
    ResponseGroup: 'Small,Images'
opHelper.execute 'ItemLookup', args, callback

// within callback(err, resp) assuming no err:
item = resp?.Items?.Item
console.log item.DetailPageURL

The console logs:

http://www.amazon.com/Discraft-gram-Ultimate-Ultra-Star-disc/dp/B001I8FCGK%3FSubscriptionId%3DAKIAID6UC74GIHYWM6EQ%26tag%3Dthingdom-20%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3DB001I8FCGK

The %3F should be ?, the %3Ds should be =s and the %26s should be &s.

Thanks in advance for looking into this!

dmcquay commented 8 years ago

Wow this is REALLY old. So, you probably don't care anymore, but I'm cleaning out old bugs that never got addressed and I'm not sure that this one really needs fixing. I can't reproduce this issue in a few lookups. It looks like Amazon may have changed how their image URLs look across the board and that may have solved this issue. But if you can find an item lookup that generates this problem, please reopen this and let me know the item id, I will hop right on it. Unfortunately when I query for the item id 'B001I8FCGK' no items are found.

dmcquay commented 8 years ago

Actually I was being dumb and looking in the wrong place. This is easy to reproduce, but the URLs are coming to me this way in the raw response body. It is not a problem with the parsing on my end. Perhaps this is a bug on Amazon's side. I'm not inclined to stress about it since these URLs work despite being nonstandard.