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

Rename header name constants #7

Merged
merged 1 commit into from
Jun 9, 2021

Conversation

AlanGabbianelli
Copy link
Contributor

This changes:

  • ACCOUNT_SESSION_REQUEST_HEADER_NAME to
    ACCOUNT_SESSION_INTERNAL_HEADER_NAME

  • ACCOUNT_SESSION_RESPONSE_HEADER_NAME to
    ACCOUNT_SESSION_HEADER_NAME

  • ACCOUNT_END_SESSION_RESPONSE_HEADER_NAME to
    ACCOUNT_END_SESSION_HEADER_NAME

"GOVUK-Account-Session" is the externally available header's name both
for requests and responses. It only in gets changed by Rails in the
controller, where it becomes "HTTP_GOVUK_ACCOUNT_SESSION".

So it makes sense to have "GOVUK-Account-Session" in a constant called
ACCOUNT_SESSION_HEADER_NAME and have "HTTP_GOVUK_ACCOUNT_SESSION" in
a constant called ACCOUNT_SESSION_INTERNAL_HEADER_NAME.

Similarly, this also removes the RESPONSE qualifier from the constant
that holds "GOVUK-Account-End-Session" so that it now becomes simply
ACCOUNT_END_SESSION_HEADER_NAME.

This changes:

- `ACCOUNT_SESSION_REQUEST_HEADER_NAME` to
  `ACCOUNT_SESSION_INTERNAL_HEADER_NAME`

- `ACCOUNT_SESSION_RESPONSE_HEADER_NAME` to
  `ACCOUNT_SESSION_HEADER_NAME`

- `ACCOUNT_END_SESSION_RESPONSE_HEADER_NAME` to
  `ACCOUNT_END_SESSION_HEADER_NAME`

`"GOVUK-Account-Session"` is the externally available header's name both
for requests and responses. It only in gets changed by Rails in the
controller, where it becomes `"HTTP_GOVUK_ACCOUNT_SESSION"`.

So it makes sense to have `"GOVUK-Account-Session"` in a constant called
`ACCOUNT_SESSION_HEADER_NAME` and have `"HTTP_GOVUK_ACCOUNT_SESSION"` in
a constant called `ACCOUNT_SESSION_INTERNAL_HEADER_NAME`.

Similarly, this also removes the `RESPONSE` qualifier from the constant
that holds `"GOVUK-Account-End-Session"` so that it now becomes simply
`ACCOUNT_END_SESSION_HEADER_NAME`.
@AlanGabbianelli AlanGabbianelli merged commit 313403f into main Jun 9, 2021
@AlanGabbianelli AlanGabbianelli deleted the rename-header-name-constants branch June 9, 2021 14:42
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