MrRefactoring / jira.js

A JavaScript/TypeScript wrapper for the JIRA Cloud, Service Desk and Agile REST API

Home Page:https://mrrefactoring.github.io/jira.js/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AxiosError ERR_FR_MAX_BODY_LENGTH_EXCEEDED

RealBuddy opened this issue · comments

I'm getting this error, trying to attach the file to the tickets
can we add these two params to the
maxContentLength: Infinity, maxBodyLength: Infinity

to

addAttachment(parameters, callback) { var _a; return tslib_1.__awaiter(this, void 0, void 0, function* () { const formData = new FormData(); const attachments = Array.isArray(parameters.attachment) ? parameters.attachment : [parameters.attachment]; attachments.forEach(attachment => formData.append('file', attachment.file, attachment.filename)); const config = { url:/rest/api/3/issue/${parameters.issueIdOrKey}/attachments, method: 'POST', headers: Object.assign({ 'X-Atlassian-Token': 'no-check', 'Content-Type': 'multipart/form-data' }, (_a = formData.getHeaders) === null || _a === void 0 ? void 0 : _a.call(formData)), data: formData, maxContentLength: Infinity, maxBodyLength: Infinity }; return this.client.sendRequest(config, callback); }); }
in

/jira.js/out/version3/issueAttachments.js

That was super quick! Thanks!

@MrRefactoring
I'm sorry to reopen the issue, but you have got it fixed only for the version 2.
Could you please apply the same fix to the version 3 of the API?
Thank you!

Oh my god. Why I’m fixed only version 2? 🤦‍♂️

:)
Thanks!