-
-
Notifications
You must be signed in to change notification settings - Fork 344
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
.withRequestMultipartFileUpload() detects application/pdf or application/octet-stream type as text/plain #1094
Comments
Thanks for the repro. I also get the
@uglyog FYI. I think in this case, you're best falling back to not using that method, and using something like this instead:
|
Latest pact versions. Same with image/png file:
When I change the "application/octet-stream" to "image/png", I got the error other way around: @mefellows Can this please be fixed? :) |
Thanks for contributing to the discussion, there is no need to ask for it to be fixed though. Clearly there is a bug that needs fixing. You're welcome to help fix it, or use the suggested workaround. We'll get to a fix when we can. |
@mefellows I did some extra testing, but this is a pact-js-core issue in my opinion. If I change this test with a .png image file, the same error occures. |
Software versions
Issue Checklist
Please confirm the following:
Expected behaviour
When testing
multipart/form-data
upload, PDF file should be detected asapplication/pdf
orapplication/octet-stream
Actual behaviour
The uploaded PDF file is detected as
text/plain
.Moreover on Azure DevOps agent running Ubuntu, the same file is detected as
text/x-tex
I'm not 100% sure but I think it is related to mime type detection logic here
Steps to reproduce
Clone https://github.com/spawluk-zartis/pact-multipart-form-data-upload
Relevant log files
The text was updated successfully, but these errors were encountered: