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

PDE-3006 fix(legacy-scripting-runner): fix issues with file uploading #496

Merged
merged 1 commit into from
Feb 28, 2022

Conversation

eliangcs
Copy link
Member

@eliangcs eliangcs commented Feb 24, 2022

Fixes two bugs with file uploading.

  1. The Content-Type header should be set to multipart/form-data when uploading a file. We were using form-data to generate the request body, but we should also use form.getHeaders() to generate a header like Content-Type: multipart/form-data; boundary=----12345678.

  2. Hanging issue. We were using the request package for 1) z.request in the legacy script and 2) downloading files. I found when there's a sync z.request call in the legacy script, the request call to download a file can hang the entire process. I'm not sure why but I guess it's related to deasync. This PR fixes the issue by replacing request with node-fetch to download files.

@eliangcs eliangcs marked this pull request as ready for review February 25, 2022 03:32
@eliangcs eliangcs requested a review from xavdid as a code owner February 25, 2022 03:32
@eliangcs eliangcs merged commit 0d5742f into master Feb 28, 2022
@eliangcs eliangcs deleted the PDE-3006-file-uploading-issues branch February 28, 2022 03:37
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

Successfully merging this pull request may close these issues.

2 participants