Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
2.0.1
-
None
-
None
Description
I am trying to set up a Karaf Cave proxy of an Archiva repository filled with OSGi bundles, and noticed that Cave would not find any OSGi bundles after scanning the repository (e.g. by traversing the URLs under the /repository/ path). When investigating why, I noticed that Archiva sends in the HTTP response Content-Type header
Content-Type: application/java-archive;charset=UTF-8
The ;charset=UTF-8 caught me eye, and then I looked in Cave's source and noticed it performs a full string comparison, looking for just application/java-archive. I thought perhaps the error was more on the Archiva side, as sending the charset for the binary payload seems incorrect.
To be clear, I expected to see the following header:
Content-Type: application/java-archive
Looking in Archiva's apps/archiva/WEB-INF/web.xml I saw why the charset parameter was provided:
<filter-mapping> <filter-name>encodingFilter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping>
That filter forcibly applies the charset parameter to all responses.