Validate security headers in API response
Preconditions (2)
Step 1: Send a GET request to the API endpoint https://api.example.com/data
Step 2: Inspect the response headers
Step 3: Verify that the following security headers are present:
Step 4: - Content-Security-Policy
Step 5: - X-Content-Type-Options
Step 6: - Strict-Transport-Security
Step 7: - X-Frame-Options
Step 8: - Referrer-Policy
Step 9: Verify that each header has the expected value:
Step 10: - Content-Security-Policy: default-src 'self'
Step 11: - X-Content-Type-Options: nosniff
Step 12: - Strict-Transport-Security: max-age=31536000; includeSubDomains
Step 13: - X-Frame-Options: DENY
Step 14: - Referrer-Policy: no-referrer
✅ Expected Result: All listed security headers are present in the response with the exact expected values.