-
-
Notifications
You must be signed in to change notification settings - Fork 522
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
Publisher-Electron-Release-Server: Asset Upload fails with 400 Bad Request (file size seems to be missing) #2087
Labels
Comments
monsterkrampe
added a commit
to monsterkrampe/electron-forge
that referenced
this issue
Dec 14, 2020
…set upload ISSUES CLOSED: electron#2087
The missing |
5 tasks
Valid fix here #2088 but in conflict, if someone rebases it can land |
Will do in the next days, thx @MarshallOfSound :) |
monsterkrampe
added a commit
to monsterkrampe/electron-forge
that referenced
this issue
Feb 5, 2022
…set upload ISSUES CLOSED: electron#2087
5 tasks
monsterkrampe
added a commit
to monsterkrampe/electron-forge
that referenced
this issue
Feb 5, 2022
…set upload ISSUES CLOSED: electron#2087
monsterkrampe
added a commit
to monsterkrampe/electron-forge
that referenced
this issue
Mar 2, 2022
…set upload ISSUES CLOSED: electron#2087
Merged - thanks again for the bug report and fix, @monsterkrampe! 🙇♀️ |
You're very welcome :) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Preflight Checklist
Issue Details
Expected Behavior
I setup an electron release server using the docker image from docker hub https://hub.docker.com/r/eoskin/electron-release-server. Now I tried publishing packages using the built-in electron-forge publisher.
I would expect that the upload works out of the box.
Actual Behavior
The server is throwing a
400 Bad Request
when uploading the assets.The server side validation fails because the file size is missing. I dug into the packages used on the server side quite a bit but I could not find an issue. Also the upload in the web interface works as expected.
According to the
form-data
library that is used in the electron forge publisher, it seems to be required that the file size is set explicitly usingknownLength
. They have a note in their readme saying: "getLengthSync() method DOESN'T calculate length for streams, use knownLength options as workaround." There is also an issue that seems to be related: form-data/form-data#426This is currently not done in the Publisher-Electron-Release-Server package.
To Reproduce
Setup an
electron-release-server
using the docker image and try publishing packages usingelectron-forge
(I guess it should happen independent of the platform, etc., though I only tested it for linux zips right now.)Additional Information
I'm actually a little puzzled that there is no issue created regarding that yet, since I cannot imagine that I am the only one having this problem. Sorry if I just overlooked something.
Nevertheless, I will submit a PR containing a workaround using the
knownLength
option, since this seems to be the way to go for now according to theform-data
package. I also tested this out right now and it indeed fixes the issue for me.The text was updated successfully, but these errors were encountered: