cloudfoundry / staticfile-buildpack

Deploy static HTML/JS/CSS apps to Cloud Foundry
Apache License 2.0
200 stars 329 forks source link

Missing mime type for otf files (opentype fonts) ? #352

Open arnaudruffin opened 1 year ago

arnaudruffin commented 1 year ago

What version of Cloud Foundry and CF CLI are you using? (i.e. What is the output of running cf curl /v2/info && cf version? CF :

What version of the buildpack you are using? staticfile_buildpack_v1_5_36

If you were attempting to accomplish a task, what was it you were attempting to do? I expose some otf assets

What did you expect to happen? I would expect them to be exposed with "Content-Type: font/otf" (and with Content-Encoding: gzip)

What was the actual behavior? The files are served, but with Content-Type: application/octet-stream

I am under the impression that the configuration is missing from mime.types. I saw the following issue + PR https://github.com/cloudfoundry/staticfile-buildpack/issues/87 that added the configuration for the other types of font, but not for otf files.

I wanted to check and push a pull request but I can't make out how the mime.types file is generated/retrieved.

arjun024 commented 1 year ago

I don't see otf in the default https://github.com/nginx/nginx/blob/master/conf/mime.types Are you able to use the nginx-buildpack for this purpose? I'm not very familiar with otf to say it should be included in the staticfile buildpack

arjun024 commented 1 year ago

@ryanmoran @johnnyr0x thoughts?

arjun024 commented 1 year ago

I'm closing this issue under the premise that this is a usecase for nginx buildpack and not staticfile buildpack. Please feel free to reopen the issue for any further conversation

ryanmoran commented 1 year ago

@arnaudruffin we would happily accept a PR. You can find the mimetypes list here: https://github.com/cloudfoundry/staticfile-buildpack/blob/610e933162c9d9154ab2b9f07472dbf116afe035/src/staticfile/finalize/data.go#L164

ForestEckhardt commented 1 year ago

@arnaudruffin I believe that this was resolved with #358. Is that correct?