-
-
Notifications
You must be signed in to change notification settings - Fork 299
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
PackageRegistry.publish not properly uploading files from html file input #3580
Comments
Ill give it a look and follow up! |
I'm having this same issue. I'm assuming the issue has something to do with the
It's not supposed to be using gitbeaker/packages/core/src/infrastructure/RequestHelper.ts Lines 350 to 352 in d64af2a
|
Hmm yes, i used FormData since many of the other API's that transfer file data tend to leverage this method. In this case you mention "raw" but what is the actual data type? Blob? |
I said "raw", because you'd set the Using
So,yeah, it would be a |
Noted, Ill make those changes to support that^ |
Havent forgotten about this! Just trying not to add to the tech debt pile so its taking a bit longer than id like haha |
PackageRegistry.publish not properly uploading files from html file input
When publishing a generic package the multipart header is not removed so the integrity of the file is compromised.
Its working as expected when using directly the gitlab API with fetch, but when im doing the same with gitbeaker the file still has the headers for multipart stuff in it.
Maybe its just me doing it wrong but I haven't seen any example in the documentation about publishing a package.
Here's the code i used to get the issue
Here's the headers im talking about
Working example with fetch
Result with fetch
Steps to reproduce
Try to upload a binary file from an html file input
Expected behaviour
The data should be the same as the original file
Actual behaviour
The headers are not removed so the file is no longer the same as the original
Possible fixes
The contentType in the options does not seems to be doing anything no matter what I put the result is the same, it looks like it defaults to application/octet-steam
Checklist
The text was updated successfully, but these errors were encountered: