Skip to content

Commit

Permalink
Added Accept-Language header
Browse files Browse the repository at this point in the history
  • Loading branch information
libern committed Sep 8, 2016
1 parent 68d4d67 commit 0568283
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Someline/Rest/RestClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -292,9 +292,11 @@ private function configureOptions($options)
$headers = $this->getServiceConfig('headers');

// add client ip to header
$clientIp = request()->getClientIp();
$request = request();
$clientIp = $request->getClientIp();
$headers['X-Client-Ip'] = $clientIp;
$headers['X-Forwarded-For'] = $clientIp;
$headers['Accept-Language'] = $request->header('Accept-Language', app()->getLocale());

if ($this->use_oauth_token_grant_type) {
$headers['Authorization'] = 'Bearer ' . $this->getOAuthToken($this->use_oauth_token_grant_type);
Expand Down

0 comments on commit 0568283

Please sign in to comment.