Skip to content

Add HTTP Referer configuration#82

Merged
dblock merged 1 commit intodblock:masterfrom
agrberg:add_http_referer
Sep 8, 2020
Merged

Add HTTP Referer configuration#82
dblock merged 1 commit intodblock:masterfrom
agrberg:add_http_referer

Conversation

@agrberg
Copy link
Copy Markdown
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
Copy Markdown
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.

Comment thread README.md Outdated
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
Copy Markdown
Owner

Choose a reason for hiding this comment

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

@dblock
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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