Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When 'null' is in an array of tags, signature breaks #581

Closed
rhwinter opened this issue Dec 21, 2022 · 0 comments
Closed

When 'null' is in an array of tags, signature breaks #581

rhwinter opened this issue Dec 21, 2022 · 0 comments

Comments

@rhwinter
Copy link

rhwinter commented Dec 21, 2022

Describe the bug in a sentence or two.

When doing

tags = ['test', null];
await cloudinary.v2.uploader.replace_tag(tags, public_id, { type: "private" });

I get a "Invalid Signature" 401 error.

Issue Type (Can be multiple)

[ ] Build - Can’t install or import the SDK
[ ] Babel - Babel errors or cross browser issues
[ ] Performance - Performance issues
[X] Behaviour - Functions aren’t working as expected (Such as generate URL)
[ ] Documentation - Inconsistency between the docs and behaviour
[ ] Incorrect Types - For typescript users who are having problems with our d.ts files
[ ] Other (Specify)

Steps to reproduce

import cloudinary from 'cloudinary';
import configuration from 'somewhere';

cloudinary.config({
    ...configuration.secrets.cloudinary,
    secure: true
});

const public_id = 'some public ID here',
tags = ['test', null];
await cloudinary.v2.uploader.replace_tag(tags, public_id, { type: "private" });

Versions and Libraries (fill in the version numbers)

Cloudinary_NPM SDK version 1.33.0
Node - 19.3.0
NPM - 9.2.0

Further comments

Changing line 386 in /lib/uploader.js to

params.tag = tag.filter(t => t);

Fixes the issue, but I think the real problem lies in how clear_blank() (in /lib/utils/index.js) is implemented, but I didn't have time to dig too much deeper.

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

No branches or pull requests

1 participant