Issue 18024

Varnish ignores Accept-Language header in species API

18024
Reporter: mdoering
Type: Bug
Summary: Varnish ignores Accept-Language header in species API
Priority: Critical
Status: Open
Created: 2015-11-09 17:00:45.463
Updated: 2016-02-10 14:35:39.69
        
Description: The species API uses the Accept-Language header to determine the language of the primary vernacularName property of a NameUsage.

This is ignored in varnish and the first to come is cached:

{quote}
$ curl -s -H 'Accept-Language: de' api.gbif.org/v1/species/5231190 | jq .vernacularName
"Haussperling"

$ curl -s -H 'Accept-Language: en' api.gbif.org/v1/species/5231190 | jq .vernacularName
"Haussperling"

$ curl -s -H 'Accept-Language: en' api.gbif.org/v1/species/5231190?language=en | jq .vernacularName
"house sparrow"
{quote}]]>