dblock / iex-ruby-client

IEX Finance API Ruby Client
MIT License
118 stars 60 forks source link

Add HTTP Referer configuration #82

Closed agrberg closed 3 years ago

agrberg commented 3 years ago

Enables passing in a referer configuration option to set the HTTP Referer header. This is necessary to lock tokens to a domain.

There weren't tests for each individual configuration variable, default, or headers (testing Faraday's API maybe?) so I wasn't sure what to add. I can confirm it works in actual usage in my app and that bundle exec rake runs clean after all changes too.

dblock commented 3 years ago

.. btw I can be convinced otherwise with referrer vs. referer if other clients correct this, but I see referer everywhere, including AWS docs

agrberg commented 3 years ago

I honestly didn't know so I felt that on the human API layer it could be spelled properly and only translated at the last moment to the canonized misspelling. I also think that anyone messing around with the Referer header probably expects the misspelling so I'm happy to change it around.

dblock commented 3 years ago

Thanks!