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

Request path gets decoded on both consumer and provider side. #1326

Open
ZawadaZSE opened this issue Mar 15, 2021 · 4 comments
Open

Request path gets decoded on both consumer and provider side. #1326

ZawadaZSE opened this issue Mar 15, 2021 · 4 comments

Comments

@ZawadaZSE
Copy link

Hey,

I've got an endpoint that takes value via path param. This value can contain forward slash ie Some/Value.

I'm using pact-jvm in version 4.2.0.

I want to write consumer test against that endpoint. My client encodes this value to Some%2FValue.
I've got interaction defined with .path("/endpoint/Some%2FValue"). I've debugged execution and it fails to match request to expectation.
I'm using default MockHttpServer and when HttpExchange gets transformed to Request path gets decoded, ergo does not match expectation.

Same problem is visible on provider side. I've manually edited contract file to contain "/endpoint/Some%2FValue".
Unfortunately my endpoint gets called with "/endpoint/Some/Value".

I've seen couple old closed tickets here that say it should work. Documentation is pretty vague about it. Is it regression or am I doing something wrong?

@uglyog
Copy link
Member

uglyog commented Mar 27, 2021

It must be a regression

@uglyog
Copy link
Member

uglyog commented Mar 27, 2021

If you use the KTor mock server instead of the Java Http one, it works.

@uglyog
Copy link
Member

uglyog commented Mar 27, 2021

On the provider side, you need to set the pact.verifier.disableUrlPathDecoding JVM system propery

@uglyog
Copy link
Member

uglyog commented Mar 28, 2021

Released 4.2.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants