Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression on matchHeader with commas ? #1159

Open
AlexTess opened this issue Jul 3, 2020 · 2 comments
Open

Regression on matchHeader with commas ? #1159

AlexTess opened this issue Jul 3, 2020 · 2 comments
Labels
bug Indicates an unexpected problem or unintended behavior

Comments

@AlexTess
Copy link

AlexTess commented Jul 3, 2020

Hello,

I'm in the process of upgrading from 3.5.24 to latest version ( 4.1.6) and I've come accross what seems to be a regression in the Pact Verification phase on match header.

My consumer contract contains the following in the dsl :

.matchHeader("Last-Modified", "[a-zA-Z]{3}, [0-9]{1,2} [a-zA-Z]{3} [0-9]{4} [0-9]{2}:[0-9]{2}:[0-9]{2} [A-Z]{3}",
                        "Fri, 7 Jun 2019 16:47:07 GMT")

When running the pact verification, I'm getting the following errors:

1) Verifying a pact between xxx and yyy - Scenario: refresh 

    1.1) HeaderMismatch: Expected 'Fri' to match '[a-zA-Z]{3}, [0-9]{1,2} [a-zA-Z]{3} [0-9]{4} [0-9]{2}:[0-9]{2}:[0-9]{2} [A-Z]{3}'

    1.2) HeaderMismatch: Expected '3 Jul 2020 14:39:44 GMT' to match '[a-zA-Z]{3}, [0-9]{1,2} [a-zA-Z]{3} [0-9]{4} [0-9]{2}:[0-9]{2}:[0-9]{2} [A-Z]{3}'

I should point out this works fine with previous 3.5.24 version, so there is no issue with the data generated itself.
the header itself matches the regex
Fri, 03 Jul 2020 14:49:46 GMT

is there something I'm missing? it seems the comma is somehow an issue in the verify ?
Im using pact provider verify through this classical code:

    void testTemplate(Pact pact, Interaction interaction, HttpRequest request, PactVerificationContext context) {
        try{
                context.verifyInteraction();

   }

Thanks in advance for any tips.

@uglyog uglyog added the bug Indicates an unexpected problem or unintended behavior label Jul 12, 2020
@uglyog
Copy link
Member

uglyog commented Jul 12, 2020

Result of #997

@uglyog
Copy link
Member

uglyog commented Aug 9, 2020

4.1.7 has been released with this fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

2 participants