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

Failed to execute 'setRequestHeader' on 'XMLHttpRequest' #203

Open
m-swat opened this issue Oct 24, 2022 · 0 comments
Open

Failed to execute 'setRequestHeader' on 'XMLHttpRequest' #203

m-swat opened this issue Oct 24, 2022 · 0 comments

Comments

@m-swat
Copy link

m-swat commented Oct 24, 2022

Hi,
i'm getting error like 'Failed to execute 'setRequestHeader' on 'XMLHttpRequest'' on 5xx error when retrying should occur.

Here is a full Error message:

SyntaxError:Failed to execute 'setRequestHeader' on 'XMLHttpRequest': 'function(header, parser) {
header = normalizeHeader(header);

if (!header) return undefined;

const key = findKey(this, header);

if (key) {
  const value = this[key];

  if (!parser) {
    return value;
  }

  if (parser === true) {
    return parseTokens(value);
  }

  if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFunction(parser)) {
    return parser.call(this, value, key);
  }

  if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isRegExp(parser)) {
    return parser.exec(value);
  }

  throw new TypeError('parser must be boolean|regexp|function');
}

}' is not a valid HTTP header field value.`

It looks like the whole function definition is passed as a header value :o

I'm using the newest Axios version(1.1.3) and the newest retry-axios. No idea what is wrong. The same code is working fine with Axios 0.27.x.

Any idea what could be wrong?

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