From fe87c003ea04fcac8fc34c13873fbcf2ac61f5bc Mon Sep 17 00:00:00 2001 From: andrew-jameson Date: Thu, 12 Sep 2024 16:24:02 -0400 Subject: [PATCH] Nginx change to try forcing Referer in header to be passed for the POST to succeed --- .circleci/deployment/workflows.yml | 2 ++ tdrs-frontend/cypress/e2e/accounts/accounts.feature | 4 +++- tdrs-frontend/nginx/cloud.gov/locations.conf | 3 ++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.circleci/deployment/workflows.yml b/.circleci/deployment/workflows.yml index 8a4269c04..edac327c1 100644 --- a/.circleci/deployment/workflows.yml +++ b/.circleci/deployment/workflows.yml @@ -28,6 +28,7 @@ branches: only: - develop + - bug/3141-e2e-failing - main - deploy-infrastructure-production: filters: @@ -100,6 +101,7 @@ branches: only: - develop + - bug/3141-e2e-failing - deploy-staging: requires: - deploy-infrastructure-staging diff --git a/tdrs-frontend/cypress/e2e/accounts/accounts.feature b/tdrs-frontend/cypress/e2e/accounts/accounts.feature index 86dc01e6c..b2bc8007e 100644 --- a/tdrs-frontend/cypress/e2e/accounts/accounts.feature +++ b/tdrs-frontend/cypress/e2e/accounts/accounts.feature @@ -19,7 +19,9 @@ Feature: Users can create and manage their accounts When 'new-cypress@teamraft.com' visits the home page And 'new-cypress@teamraft.com' logs in Then 'new-cypress@teamraft.com' requests access - And The admin sets the approval status of 'new-cypress@teamraft.com' to 'Approved' + Given The admin logs in + Then The admin sets the approval status of 'new-cypress@teamraft.com' to 'Approved' + And 'new-cypress@teamraft.com' logs in Then 'new-cypress@teamraft.com' can see the hompage Scenario: A new user is denied access Given The admin logs in diff --git a/tdrs-frontend/nginx/cloud.gov/locations.conf b/tdrs-frontend/nginx/cloud.gov/locations.conf index 592063439..a52712d3c 100644 --- a/tdrs-frontend/nginx/cloud.gov/locations.conf +++ b/tdrs-frontend/nginx/cloud.gov/locations.conf @@ -4,7 +4,8 @@ location ~ ^/(v1|admin|static/admin|swagger|redocs) { resolver 169.254.0.2; set $backend http://{{env "BACKEND_HOST"}}.apps.internal:8080$request_uri; proxy_pass $backend; - proxy_pass_header x-csrftoken; + proxy_set_header Host ; + proxy_pass_header x-csrftoken Referer; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;