[thredds] Content-Length Zero for HTTP Head Request

Hi All,

When requesting a Http HEAD request to Thredds fileserver http service, the 
"Content-Length" http header in the response is always zero.
However, it is working fine in the Http GET request for the http file service.
Anyone has a idea of why Content-Length is zero in HEAD request?

The above issue is causing a Java exception as below:

> java.io.IOException: Server does not support Content-Length
>         at 
> ucar.unidata.io.http.HTTPRandomAccessFile.<init>(HTTPRandomAccessFile.java:104)
>         at 
> ucar.unidata.io.http.HTTPRandomAccessFile.<init>(HTTPRandomAccessFile.java:78)
>         at ucar.nc2.NetcdfFile.getRaf(NetcdfFile.java:277)
>         at ucar.nc2.NetcdfFile.open(NetcdfFile.java:258)
>         at ucar.nc2.dataset.NetcdfDataset.openFile(NetcdfDataset.java:335)
>         at ucar.nc2.dataset.NetcdfDataset.openDataset(NetcdfDataset.java:175)
>         at ucar.nc2.ncml.NcMLReader.readNcML(NcMLReader.java:317)
>         at ucar.nc2.ncml.NcMLReader.readNcML(NcMLReader.java:239)
>         at ucar.nc2.ncml.NcMLReader.readNcML(NcMLReader.java:219)

ucar.unidata.io.http.HTTPRandomAccessFile sends Http HEAD request to Thredds 
fileserver service
and since Apache Server will auto filter out zero "Content-Length", hence, 
exception is fired.

We are using Apache as the front HTTP server for Tomcat.

Apache 2.2
Tomcat 6.0.32
Thredds 4.2

Thanks,

Ming Fu
Software Engineer

Tasmanian Partnership for Advanced Computing
University of Tasmania