Skip to content

request: Omit CSRF token for non-validated requests#8509

Merged
aduth merged 2 commits intomainfrom
aduth-request-no-csrf-get-head
May 31, 2023
Merged

request: Omit CSRF token for non-validated requests#8509
aduth merged 2 commits intomainfrom
aduth-request-no-csrf-get-head

Conversation

@aduth
Copy link
Contributor

@aduth aduth commented May 30, 2023

🛠 Summary of changes

Updates the request utility to avoid including the CSRF token if it is not necessary for the request.

See related Slack discussion: https://gsa-tts.slack.com/archives/C0NGESUN5/p1685476447724009

Easier to review changes with whitespace hidden: https://github.com/18F/identity-idp/pull/8509/files?w=1

📜 Testing Plan

  • yarn test
  • Verify that session timeout polling requests complete successfully

It's easier to test the latter by setting a very low session timeout in local config/application.yml:

session_timeout_in_minutes: 1

changelog: Internal, Performance, Exclude request forgery token from front-end requests when not required
Copy link
Contributor

@zachmargolis zachmargolis left a comment

Choose a reason for hiding this comment

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

LGTM

@aduth aduth merged commit 45d88d6 into main May 31, 2023
@aduth aduth deleted the aduth-request-no-csrf-get-head branch May 31, 2023 12:24
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.

3 participants