nextstrain / nextstrain.org

The Nextstrain website
https://nextstrain.org
GNU Affero General Public License v3.0
87 stars 49 forks source link

upstream: Forward Content-Type from upstream if we don't already have one #835

Closed tsibley closed 2 months ago

tsibley commented 2 months ago

For example, our RESTful endpoints perform content negotiation and use the result to determine Content-Type (and also what to Accept in the request to upstream), but our Charon endpoints do not set Content-Type at all. Set it based on the upstream response in that situation.

I noticed this bug (while investigating another issue¹) because the automatic compression middleware wasn't applying to the /charon/getDataset endpoint due to the lack of Content-Type.

¹ https://github.com/nextstrain/nextstrain.org/issues/832

Checklist