Unidata / thredds-docker

Dockerized THREDDS

Home Page:https://hub.docker.com/r/unidata/thredds-docker

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

can't set content-type for `.json` files properly, not applying `config/web.xml`?

wwlwpd opened this issue · comments

To report a non-security related issue, please provide:

  • the version of the software with which you are encountering an issue

We are using the docker container, version 4.5.16 (latest at the time of this issue).

  • environmental information (i.e. Operating System, compiler info, java version, python version, etc.)

Docker image via, https://hub.docker.com/r/unidata/thredds-docker

  • a description of the issue with the steps needed to reproduce it

Content type seems to not be getting set.

This curl command will pull a live file, but the content header is set as application/octet-stream

curl -v http://chg-1.oden.tacc.utexas.edu/thredds/fileServer/asgs/2021/nam/2021081318/SABv20a/frontera.tacc.utexas.edu/SABv20a_nam_jgf/nowcast/scenario.status.json > test.json

image

If you have a general question about the software, please view our Suggested Support Process.

If this is not a bug (seems like it could be), then how does one make sure that conf/web.xml mime type mappings are applied properly or as desired?

Thank you!

hi, I've determined that thredds (HTTPServer) seems to not use any of the mime defs in web.xml - most important is that I need to be able to add some mime types for files that are downloaded directly - how do I accomplish this.

@wwlwpd sorry I did not see this when it originally came through. Would it be possible to see all the json related mime-mappings currently available in your web.xml. I'd just like to sanity check that. Also this may, strictly speaking, not be a thredds-docker issue but related to thredds itself. Also how is the web.xml being mounted in to the container? I wonder if there is a problem there.

Oh, sorry for the delay!

Here's the entry for JSON:

    <mime-mapping>
        <extension>json</extension>
        <mime-type>application/json</mime-type>
    </mime-mapping>

This is the one already in the container, /usr/local/tomcat/conf/web.xml. I did try to add a few other entries to make some files be treated as plain/text but it doesn't work and not worth debugging until I figure this json thing out. Thanks!!

Since, I do not believe this is a docker issue per se, I am referencing this core tds issue Unidata/tds#161 and closing this one.

thank you!