Conversation
…mime type, when no Content-Type: header is found in the incoming data part. (#8344)
|
testing slack activity feed. (@pdurbin) |
|
@landreev I can deploy due to a flyway conflict, does this pr need to be refreshed from develop? |
|
Having looked into the reason this could not be easily reproduced on datavese-internal - my very first guess (shockingly!) appears to have been correct. The version of curl we have on the linux boxes is smarter than the one I have on my MacBook. It does actually send the default mime type header when called as described in my test scenario: ... and that triggers the application to use the jhove-detected type, so the file ends up being properly typed as "image/jpeg". To reiterate, the problem this PR was supposed to solve was not with curl. The problem was a file upload without a mime type header in the request. The curl line was just an easy way to produce such an upload that I knew of. You should still be able to replicate it with curl, by going remotely from your own Macbook, like (assuming your curl version is the same as mine; I would not count on it 100%) Yet another way to test it would be using pyDataverse (that's how the issue was discovered; and that's the main use case I'm trying to fix). But then you'll have to mess with Python code, installing the module, etc. |
see the issue.
What this PR does / why we need it:
Which issue(s) this PR closes:
Closes #8344
Special notes for your reviewer:
Suggestions on how to test this:
To reproduce the issue: try to upload a valid jpeg, exactly as shown below:
cat test.jpg | curl -H X-Dataverse-key:XXX -X POST -F "file=@-" -F 'jsonData={"label":"test_stream.jpg"}' http://localhost:8080/api/datasets/NNN/addthe file will upload, but will be identified as "text/plain". The PR should fix this.
Does this PR introduce a user interface change? If mockups are available, please link/include them here:
Is there a release notes update needed for this change?:
Additional documentation: