shiftcommerce / flex-ruby-gem

💎 The Ruby library used to integrate with the Shift Platform API
MIT License
2 stars 0 forks source link

Add X-Forwarded-For header #185

Closed paulspringett closed 4 years ago

paulspringett commented 4 years ago

Alternatives

JsonApiClient provides the ability to add custom headers to an individual request, however this method would require a change everywhere we call the API.

MyApi::SomeResource.with_headers(x_forwarded_for: request.ip) do
  MyApi::SomeResource.find(1)
end

See: https://github.com/JsonApiClient/json_api_client#custom-headers