Skip to content

Commit 5ccf093

Browse files
committed
runfix: Add 'maxBodyLength' to GitHub POST request
1 parent 66f08a8 commit 5ccf093

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

bin/deploy-tools/lib/GitHubDraftDeployer.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* along with this program. If not, see http://www.gnu.org/licenses/.
1717
*/
1818

19-
import axios, {AxiosError} from 'axios';
19+
import axios, {AxiosError, AxiosRequestConfig} from 'axios';
2020
import fs from 'fs-extra';
2121
import logdown from 'logdown';
2222

@@ -164,7 +164,12 @@ export class GitHubDraftDeployer {
164164
}
165165

166166
try {
167-
await axios.post(url, file, {headers, maxContentLength: TWO_HUNDRED_MB_IN_BYTES});
167+
const requestConfig: AxiosRequestConfig = {
168+
headers,
169+
maxBodyLength: TWO_HUNDRED_MB_IN_BYTES,
170+
maxContentLength: TWO_HUNDRED_MB_IN_BYTES,
171+
};
172+
await axios.post(url, file, requestConfig);
168173
} catch (uploadError) {
169174
if ((uploadError as AxiosError).isAxiosError && uploadError.response) {
170175
this.logger.error('Error response from GitHub:', uploadError.response.data);

0 commit comments

Comments
 (0)