Pomax / node-flickrapi

A node.js (and client-library) implementation of the Flickr API with oauth API key authentication and API method proxying
177 stars 52 forks source link

API is broken #88

Closed nkingsley closed 8 years ago

nkingsley commented 8 years ago

line 314 in utils.js does cleaning on the api response. It appears to be failing to clean some kind of new response.

I changed the line to:

body = body.trim().replace(/^\/\*\*\/jsonFlickrApi\(/,'').replace(/\}\)$/,'}');

and it's working again

genffy commented 8 years ago

+1 the origin api res have a new line comment image https://github.com/Pomax/node-flickrapi/blob/master/src/utils.js#L314 that should use new more power reg or another way to deal this.

for example:

getJsonpData(body, prefix) {
  const reg = new RegExp(`\\S*${prefix}\\(`)
  return body.replace(reg,'').replace(/\}\)$/, '}')
}
razdvapoka commented 8 years ago

@nkingsley, @Genffy Thank you!

lchenay commented 8 years ago

+1 thanks for quick find.

msmichellegar commented 8 years ago

Have been experiencing issues, and this just saved me! Thanks for figuring that out!

+1000

Pomax commented 8 years ago

aah, Flickr... Thanks for finding this, I'll merge in the PR momentarily

Pomax commented 8 years ago

v0.5.0 pushed to npm - please let me know if this comes back in some way =)