puppetlabs / clj-http-client

HTTP client library wrapping Apache HttpAsyncClient
Apache License 2.0
15 stars 30 forks source link

(PE-18703) Pass negotiated locale in Accept-Language header #64

Closed ajroetker closed 7 years ago

ajroetker commented 8 years ago

This commit passes the negotiated locale via the i18n/locale variable through the Accept-Language header by default in a clj-http-client request (only in the Clojure client, not the Java client).

puppetcla commented 8 years ago

CLA signed by all contributors.

ajroetker commented 8 years ago

Verified that this does indeed pass the translation through the stack, I tested by standing up a PuppetDB and RBAC and adding a translation for a revoked token exception messages, and passing Accept-Language: fr to PuppetDB which in turn used the translated error.

ajroetker commented 8 years ago

@camlow325 was this what you had in mind or were you thinking I should lowercase all the headers?

rlinehan commented 7 years ago

👍 If there's a reasonable spot for it, it might be good to put info that we are doing this somewhere in the docs? But that could go in a separate PR (such as when we do the changelog for the next release).