Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add HTTP Referer configuration #82

Merged
merged 1 commit into from
Sep 8, 2020
Merged

Conversation

agrberg
Copy link
Collaborator

@agrberg agrberg commented Sep 8, 2020

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.

@agrberg agrberg force-pushed the add_http_referer branch 2 times, most recently from 1297446 to 54e1d8a Compare September 8, 2020 19:14
Copy link
Owner

@dblock dblock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I definitely don't think we should be correcting spelling for Referer, The https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referer doc is clearly calling this with 1 R and everybody is happy to perpetuate this mistake to avoid confusion.

README.md Outdated
@@ -463,6 +463,7 @@ timeout | Optional open/read timeout in seconds.
open_timeout | Optional connection open timeout in seconds.
publishable_token | IEX Cloud API publishable token.
endpoint | Defaults to `https://cloud.iexapis.com/v1`.
referrer | Optional string for HTTP `Referer` header, enables token domain management.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dblock
Copy link
Owner

dblock commented Sep 8, 2020

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

@agrberg
Copy link
Collaborator Author

agrberg commented Sep 8, 2020

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.

@agrberg agrberg requested a review from dblock September 8, 2020 21:42
@dblock dblock merged commit ebea5d8 into dblock:master Sep 8, 2020
@dblock
Copy link
Owner

dblock commented Sep 8, 2020

Thanks!

@agrberg agrberg deleted the add_http_referer branch September 8, 2020 22:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants