Skip to content

Commit

Permalink
fix(stencil-push): (STRF-8913) increase maxBodyLength in NetworkUtils…
Browse files Browse the repository at this point in the history
….sendApiRequest
  • Loading branch information
MaxGenash committed Jan 14, 2021
1 parent 1d84eb7 commit f2e3918
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/utils/NetworkUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ class NetworkUtils {
async sendApiRequest(options) {
const { accessToken, ...restOpts } = options;
const reqConfig = {
maxContentLength: Infinity,
maxBodyLength: Infinity,
httpsAgent: this._httpsAgent,
...restOpts,
headers: {
Expand Down
8 changes: 8 additions & 0 deletions lib/utils/NetworkUtils.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ describe('NetworkUtils', () => {
expect(axiosMock).toHaveBeenCalledWith({
url,
httpsAgent: httpsAgentMock,
maxContentLength: Infinity,
maxBodyLength: Infinity,
headers: {
'x-auth-client': 'stencil-cli',
'stencil-cli': packageInfoMock.version,
Expand Down Expand Up @@ -62,6 +64,8 @@ describe('NetworkUtils', () => {
expect(axiosMock).toHaveBeenCalledWith({
url,
httpsAgent: httpsAgentMock,
maxContentLength: Infinity,
maxBodyLength: Infinity,
headers: {
'content-type': extraHeaders['content-type'],
'x-auth-client': 'stencil-cli',
Expand Down Expand Up @@ -99,6 +103,8 @@ describe('NetworkUtils', () => {
expect(axiosMock).toHaveBeenCalledWith({
url,
httpsAgent: httpsAgentMock,
maxContentLength: Infinity,
maxBodyLength: Infinity,
headers: {
'content-type': extraHeaders['content-type'],
'x-auth-client': extraHeaders['x-auth-client'],
Expand Down Expand Up @@ -132,6 +138,8 @@ describe('NetworkUtils', () => {
expect(axiosMock).toHaveBeenCalledWith({
url,
httpsAgent: httpsAgentMock,
maxContentLength: Infinity,
maxBodyLength: Infinity,
headers: {
'x-auth-token': accessToken,
'x-auth-client': 'stencil-cli',
Expand Down

0 comments on commit f2e3918

Please sign in to comment.