https://issues.apache.org/bugzilla/show_bug.cgi?id=48337

--- Comment #4 from [email protected] 2009-12-06 17:46:45 UTC ---
(In reply to comment #2)
> First of all, thanks for taking the time to report and chase the issue! :-)

No problem. For a while there, I thought I was going mad. :)

> (In reply to comment #1)
> > FWIW, the bug appears to be in SVGImageElementBridge.openStream() (line 409 
> > on
> > the trunk):
> >    List mimeTypes = new ArrayList
> >             (ImageTagRegistry.getRegistry().getRegisteredMimeTypes());
> >    mimeTypes.add(MimeTypeConstants.MIME_TYPES_SVG);
> 
> As a matter of curiosity, I've made a quick crawl through that piece of code
> and it has been untouched for a while (i.e., it's probably a bug which has 
> been
> sitting there for a long time, not a recent regression AFAIK). It's even
> somehow curious how this has slipped through until now... ;-)

It seems that nothing else is as picky as Jersey is about this header so I
guess it will only affect people that are serving non-static images through
Jersey.... I guess I'm in an exclusive club.

> > Note that MIME_TYPES_SVG is an *array* of strings which is added directly to
> > the end of the list of mimeTypes. This explains the
> > "[Ljava.lang.String;@f429d7;" that I'm seeing in the Accept header.
> > 
> > I think the fix is simply to replace the add with:
> > 
> >    mimeTypes.addAll(Arrays.asList(MimeTypeConstants.MIME_TYPES_SVG));
> 
> The fix seems reasonable. Have you tested it? Are you able to submit the fix
> proposal in patch format instead? (Actually, I'm a lot more interested in the
> first question; if you need help with converting it to a patch, in order to
> ease review, I'll be more than willing to help you with that.)

I've tested the fix (it works) and submitted a patch.

In case anyone else has this problem before the next Batik release, my
temporary workaround is a servlet filter that scrubs the accept header before
it gets to the Jersey servlet.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to