Skip to content
This repository has been archived by the owner on Aug 17, 2019. It is now read-only.

Part of string can't setMeta() #87

Open
teegh opened this issue Jun 24, 2016 · 1 comment
Open

Part of string can't setMeta() #87

teegh opened this issue Jun 24, 2016 · 1 comment

Comments

@teegh
Copy link

teegh commented Jun 24, 2016

Hi, I am very grateful to flickrapi. I have some questions. Part of string can't setMeta() . Is this the bug ?

I tried in the following environments .
OSX 10.11
node.js v4.3
flickrapi@4.2 or flickrapi@0.3.32

var FlickrAPI  = require("flickrapi");
var flickrApiOptions = {
      api_key            : "xxx",
      secret             : "xxx",
      permissions        : "xxx",
      user_id            : "xxx",
      access_token       : "xxx",
      access_token_secret: "xxx"
        };

FlickrAPI.authenticate(flickrApiOptions, function(error, flickr) {

      if(!error){

        flickr.photos.setMeta(apiOptions, function(err, result) {

          /*

          I tried the following characters .
          ()=・"!#$%\*+/:;<>?@[]^_`{}|~。「」、',.&-

          */
          var apiOptions = {
            "photo_id" : "your-photo_id" ,
            "title" : "sample title ()=・\"!#$%\\*+/:;<>?@[]^_`{}|~。「」、',.&-"
          };

          if(err) {
                console.log(err);

                /*

                Error occurs. The following string can't input in flickrapi@4.2
                |^`

                Error occurs. The following string can't input in flickrapi@0.3.32
                ()!*'

                */

          }else{
                console.log("success");

          }
        });
      }
});

The following is the error message .

could not parse body as JSON: oauth_problem=signature_invalid&debug_sbs=GET%26https%3a%2f%2fapi%2eflickr%2ecom%2fservices%2frest%2f%26api_key%3dxxx%26format%3djson%26method%3dflickr%2ephotos%2esetMeta%26oauth_consumer_key%3dxxx%26oauth_nonce%3dxxx%26oauth_signature_method%3dHMAC%2dSHA1%26oauth_timestamp%3dxxx%26oauth_token%3dxxx%26photo_id%3dxxx%26title%3dsample%2520title

Maybe, This error might occur in other method.

@Pomax
Copy link
Owner

Pomax commented Jun 27, 2016

Hmm, it could be that |, ^ and ` don't get escaped properly.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants