[tests] Properly test for multiple headers with same name in probes (#9538)

Updates the `responseHeaders` probe checks to properly test for multiple headers with the same name.

Previously the probes were using `headers.get()` which concats multiple headers into a single string, which results in the test not really checking if there are in fact multiple headers with the same name. Using `headers.raw()` allows us to properly test for that.

A couple of Python tests that were already checking for multiple `set-cookie` headers needed to be updated to match the full value, since the check now properly validates the full string match of each header (before it was basically just doing a `string.includes()` check).

This is a precursor for https://github.com/vercel/vercel/pull/9533.
This commit is contained in:
Nathan Rajlich
2023-02-24 14:07:00 -08:00
committed by GitHub
parent f09d6fce85
commit 48eed7532a
2 changed files with 50 additions and 22 deletions

View File

@@ -17,7 +17,7 @@
{
"path": "/cookie_wsgi.py",
"responseHeaders": {
"set-cookie": ["one=first", "two=second"]
"set-cookie": ["one=first; Path=/", "two=second; Path=/"]
}
}
]