Repository navigation
Conversation
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
I didn't mean to press it anyway 😂 |
Likewise, if you want me to review it, you need to pay as well |
|
|
||
| #[test] | ||
| fn match_headers_combined_custom_header_compatibility() { | ||
| let cases: &[(&[&str], &[&str], bool)] = &[ |
There was a problem hiding this comment.
If you use rstest it will generate a separate test per case
| let actual_values = if value.len() > 1 && actual_values.len() < value.len() | ||
| && !SINGLE_VALUE_HEADERS.contains(&key.to_lowercase().as_str()) { |
| let mut mismatches = vec![]; | ||
| let actual_values = if value.len() > 1 && actual_values.len() < value.len() | ||
| && !SINGLE_VALUE_HEADERS.contains(&key.to_lowercase().as_str()) { | ||
| split_header_field_lines(&actual_values) |
Normalize combined actual field lines during matching while preserving quoted commas, indexed matchers, singleton headers, and pact data. Add regression coverage for repeated custom header expectations.
Split combined custom-header values consistently for list matching, regardless of field-line grouping. Apply the same normalization in the V2 request and response plans while preserving quoted and JSON values, and add regression coverage.
1132e06 to
138fc40
Compare
|
I think there are a few regressions this PR introduces, mostly around values that contain commas. I got Claude to do some vetting and here's what it had to say (after I got it to cut down on the verbiage 😆) Regression: a repeated header whose values contain commas no longer matches itself. Only the actual side is split, so identical lines now fail. This hits consumer tests and V4 provider verification, in both engines:
Splitting the expected values too, under the same Empty members. Expected
The legacy pass comes from the padding in The two engines split different headers. Legacy skips only Behaviour change worth a test. Regex Nits: Not sure exactly what is in scope vs out of scope for Pact vs RFC 9110 vs what people use in practice. So a few open questions:
One last thing: this also has ramifications on the provider side, especially given that V2 and V3 pacts write repeated values as a single comma-separated string. So a provider that sends two separate lines will fail verification. |

Normalize combined actual field lines during matching while preserving quoted commas, indexed matchers, singleton headers, and pact data.
Add regression coverage for repeated custom header expectations.
See repro test in pact-foundation/pact-core-mock-server#16
Identified in pact-foundation/pact-net#566
Fix tested locally in pact-foundation/pact-net#567