AtomGraph / Processor

Ontology-driven Linked Data processor and server for SPARQL backends. Apache License.
https://hub.docker.com/r/atomgraph/processor/
Apache License 2.0
58 stars 6 forks source link

Locale constructed incorrectly from gp:language value #7

Closed namedgraph closed 8 years ago

namedgraph commented 9 years ago

Right now ResourceBase uses new Locale() which is then used to build Variant list and compared against Accept-Language of the request. Constructed this way, the language tag does not match and leads to 406 Not Acceptable errors.

The correct way to construct Locale from language tag seems to be Locale.forLanguageTag(): http://docs.oracle.com/javase/7/docs/api/java/util/Locale.html#forLanguageTag(java.lang.String)

namedgraph commented 8 years ago

Seems to be fixed: https://github.com/Graphity/graphity-processor/blob/d365b79e3739f0b828da658260916762ca57cd9f/src/main/java/org/graphity/processor/model/impl/ResourceBase.java#L659