From 58c02825102b5c8e036bfd537912abd9d20a0650 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Denizhan=20Dak=C4=B1l=C4=B1r?= Date: Tue, 7 Jan 2025 17:38:02 +0300 Subject: [PATCH] Enhance CORS Preflight Tests in API Gateway - Added additional CORS headers to the preflight tests for valid and simple input scenarios. - Updated test cases to include 'Origin', 'Access-Control-Request-Method', and 'Access-Control-Request-Headers' in the CORS configuration, improving test coverage for API gateway functionality. --- .../tests/api_gateway_end_to_end_tests.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/golem-worker-service-base/tests/api_gateway_end_to_end_tests.rs b/golem-worker-service-base/tests/api_gateway_end_to_end_tests.rs index 4abe1c49d1..a35849a5fe 100644 --- a/golem-worker-service-base/tests/api_gateway_end_to_end_tests.rs +++ b/golem-worker-service-base/tests/api_gateway_end_to_end_tests.rs @@ -631,6 +631,11 @@ async fn test_api_def_with_cors_preflight_for_valid_input() { Some("Content-Type, Authorization".to_string()), Some(true), Some(3600), + Some(vec![ + "Origin".to_string(), + "Access-Control-Request-Method".to_string(), + "Access-Control-Request-Headers".to_string(), + ]), ) .unwrap(); @@ -753,6 +758,11 @@ async fn test_api_def_with_cors_preflight_for_preflight_input_and_simple_input() Some("Content-Type, Authorization".to_string()), Some(true), Some(3600), + Some(vec![ + "Origin".to_string(), + "Access-Control-Request-Method".to_string(), + "Access-Control-Request-Headers".to_string(), + ]), ) .unwrap();