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

Csrf plug #136

Merged
merged 4 commits into from
Dec 10, 2014
Merged

Csrf plug #136

merged 4 commits into from
Dec 10, 2014

Conversation

gjaldon
Copy link
Contributor

@gjaldon gjaldon commented Dec 5, 2014

Closes #137

@gjaldon gjaldon mentioned this pull request Dec 5, 2014
def get_csrf_token(conn), do: Conn.get_session(conn, :csrf_token)

defp non_xhr_javascript?(conn) do
xhr? = Conn.get_req_header(conn, "x-requested-with")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@josevalim - I saw in Rack that they look for a "HTTP_X_REQUESTED_WITH" header, but JQuery sets a "X-Requested-With" header. Is it correct to look for "x-requested-with" header in Plug?

Copy link
Member

Choose a reason for hiding this comment

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

Yes. :)

@gjaldon gjaldon changed the title [WIP] Csrf plug Csrf plug Dec 10, 2014
josevalim added a commit that referenced this pull request Dec 10, 2014
@josevalim josevalim merged commit bf713ce into elixir-plug:master Dec 10, 2014
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.

CSRF Plug
2 participants