[Bug]: when setting Content-Type in a webservice, the string ";charset=utf-8" is concatenated to the response header and corrupts binary files
Apache Hop version?
2.14
Java version?
OpenJDK 17
Operating system
Windows
What happened?
The metadata object "Web Service" contains a "Content type" setting that allows to set the "Content-Type" header of the response.
However, when analyzing the response, the string ";charset=utf-8" is concatenated to it unconditionally!
This seems to make binary files corrupt; the file's content gets changed when downloaded in contrast to the file on the server.
Verified for PNG (using Content-Type "image/png") and Excel (xlsx) files (using Content-Type "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet").
Note: text-based files (e.g., CSVs, using Content-Type "text/csv") do not seem to be affected.
The used client does not make a difference, both browser, curl and Postman receive the same file, which is different to the original one (in case of xlsx and PNG).
The file to be downloaded was read using "Load file content in memory" with "Binary" data type for the file content. When sending this stream field to a "Text file output step" the binary file is written again to the server's file system for testing purposes and shows the exact same contents as the original one that got read by the "Load file content in memory"; which kind of proves that the problems must be caused by the download.
Issue Priority
Priority: 3
Issue Component
Component: Hop Server, Component: Metadata