This is the mail archive of the
kawa@sourceware.org
mailing list for the Kawa project.
Re: getting the JDK built-in web server to set the correct mime type
- From: Alex Mitchell <lexaay at gmail dot com>
- To: Per Bothner <per at bothner dot com>
- Cc: "kawa at sourceware dot org" <kawa at sourceware dot org>
- Date: Thu, 15 Aug 2013 15:55:25 +0800
- Subject: Re: getting the JDK built-in web server to set the correct mime type
- References: <CDBB1D91 dot 48D59%lexaay at gmail dot com> <51F9FBA5 dot 6050101 at bothner dot com>
Hi Per,
(sorry, this bounced from the mailing list so resending as plain text)
Thanks for fixing this, and sorry for not replying earlier, I seem to
have missed this email.
I see that you've committed this change to SVN. Unfortunately I think
there's a minor error, as I'm still getting invalid mime type when
browsing files using IE.
I believe lines 426-428 in Path.java should be
if (contentType == null) {
contentType = URLConnection.guessContentTypeFromName(getPath());
}
rather than
if (contentType != null) {
contentType = URLConnection.guessContentTypeFromName(getPath());
}
After making this change, the mime type seems to be detected correctly.
thanks,
Alex
On Thu, Aug 1, 2013 at 2:09 PM, Per Bothner <per@bothner.com> wrote:
> I've been thinking about the API for MIMI detection,
> and I think it's reasonable to support getNPath for all
> gnu.text.Path object s- but sometimes an exception is thrown
> if there is no matching FileSystemProvider. Instead, the
> caller (in this case KawaAutoHandler) can catch the exception.
>
> So I wrote the attached patch.
>
> Sorry for procrastinating while deciding on the API.
>
> --
> --Per Bothner
> per@bothner.com http://per.bothner.com/