Created attachment 21673 [details] Fix DirContextURLConnection bugs. DirContextURLConnection has bugs: 1) Does not implement the getHeaderFields() method 2) It's implementation of getHeaderField(String name) is case sensitive. 3) It returns an empty string "", rather than null, for header values which don't exist. This means that there is no way to know what header information Tomcat exposes for a file, and calling getHeaderField("Content-Type") will return "", even though there is an attribute stored as "content-type". The attached patch should fix these bugs.
Many thanks for the patch. It has been applied to trunk and proposed for inclusion in the next release of 6.0.x.
The patch has been applied to 6.0.x and will be included in the next release. Many thanks.
Thanks a lot Mark. I should get off my but and write a follow up patch to this which formats Date fields as proper HTTP header date values (RFC 1123 - "EEE, dd MMM yyyy HH:mm:ss zzz") when returned as strings, which is another current bug.
That would be great. When you are ready, open a new bug, add your patch and I'll take a look.
(In reply to comment #4) > That would be great. When you are ready, open a new bug, add your patch and > I'll take a look. > Filed bug 45101 :)