-
Couldn't load subscription status.
- Fork 323
Description
Bug report for Cloudinary NPM SDK
Before proceeding, please update to latest version and test if the issue persists
Describe the bug in a sentence or two.
If you try to use a upload_prefix without https:, the SDK still expects https.
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
- Provide the credentials using the
CLOUDINARY_URLenvironment containing the query parameterupload_prefixusing the schemehttpinstead ofhttps. - Try to upload a file using the SDK
Error screenshots
TypeError [ERR_INVALID_PROTOCOL]: Protocol "http:" not supported. Expected "https:"
at new ClientRequest (_http_client.js:155:11)
at Object.request (https.js:313:10)
at post (/workspace/node_modules/cloudinary/lib/uploader.js:484:28)
at call_api (/workspace/node_modules/cloudinary/lib/uploader.js:451:16)
at Object.upload (/workspace/node_modules/cloudinary/lib/uploader.js:49:10)
at Object.upload (/workspace/node_modules/cloudinary/lib/utils/index.js:1177:21)
at FileService.uploadFile (/workspace/dist/apps/quiz-calendar/backend/webpack:/libs/files/backend/domain/src/lib/service/file.service.ts:83:53)
at FileService.create (/workspace/dist/apps/quiz-calendar/backend/webpack:/libs/files/backend/domain/src/lib/service/file.service.ts:25:31)
at FileController.create (/workspace/dist/apps/quiz-calendar/backend/webpack:/libs/files/backend/feature-files/src/lib/controller/file.controller.ts:37:43)
at /workspace/node_modules/@nestjs/core/router/router-execution-context.js:38:29 {
code: 'ERR_INVALID_PROTOCOL'
}
Browsers (if issue relates to UI, else ignore)
[ ] Chrome
[ ] Firefox
[ ] Safari
[ ] Other (Specify)
[ ] All
Versions and Libraries (fill in the version numbers)
Cloudinary_NPM SDK version
Node - 14.15.0
NPM - 6.15.8
Config Files (Please paste the following files if possible)
Package.json
Repository
If possible, please provide a link to a reproducible repository that showcases the problem