SalesforceCommerceCloud / sfcc-ci

Salesforce Commerce Cloud CLI
https://npmjs.com/package/sfcc-ci
BSD 3-Clause "New" or "Revised" License
231 stars 94 forks source link

[ERR_INVALID_CHAR]: Invalid character in header content ["authorization"] #352

Open sridharpannewave opened 1 year ago

sridharpannewave commented 1 year ago

sfcc-ci Version

2.10.0

NodeJS Version

v12.22.12

sfcc-ci Path

/Users//.volta/bin/sfcc-ci

Host OS Details

ProductName: macOS ProductVersion: 13.1 BuildVersion: 22C65

What happened?

hi

I'm getting the below error while using this line of code

sfcc.instance.upload(creds.hostname, zipFileName, token, {}, (err) => {

    if (err) return logger.error(`Upload error: ${err}`);

    sfcc.instance.import(creds.hostname, zipFileName, token, (err, res) => {
      if (err) return logger.error(`Import error: ${err}`);

    });
  });

Error Upload error: Error: TypeError [ERR_INVALID_CHAR]: Invalid character in header content ["authorization"]

Relevant log output

**Error**  Upload error: Error: TypeError [ERR_INVALID_CHAR]: Invalid character in header content ["authorization"]
tobiaslohr commented 1 year ago

Hi @sridharpannewave, there is most likely an invalid character in the token you are passing. Can you please check this incl. any \n at the end?