Skip to content
New issue

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

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

Already on GitHub? # to your account

pact-stub-service not parsing non-ascii characters #51

Open
yaminidhamija opened this issue Sep 22, 2022 · 2 comments
Open

pact-stub-service not parsing non-ascii characters #51

yaminidhamija opened this issue Sep 22, 2022 · 2 comments

Comments

@yaminidhamija
Copy link

Whenever my request payload contains any language characters other than English, It doesn't respond and after few seconds, I get server timed out - 503 Gateway error.

"payload": {
"callback": "úrl",
}

This symbol ú is causing issue, otherwise it works fine.

Screenshot 2022-09-22 at 11 03 49 AM

@rholshausen
Copy link
Contributor

I can't replicate this. Using the latest version, it works for me (it should support all UTF-8 characters)

Stub server logs:

❯ ./target/debug/pact-stub-server -f src/test-pact-non-ascii.json 
2022-10-24T01:10:25.558884Z  INFO main pact_stub_server: Loaded 1 pacts (1 total interactions)
2022-10-24T01:10:25.559351Z  INFO tokio-runtime-worker pact_stub_server::server: Server started on port 33145
2022-10-24T01:10:41.891185Z  INFO tokio-runtime-worker pact_stub_server::server: ===> Received HTTP Request ( method: GET, path: /, query: None, headers: Some({"host": ["127.0.0.0:33145"], "user-agent": ["curl/7.81.0"], "accept": ["*/*"]}), body: Empty )
2022-10-24T01:10:41.892414Z  INFO tokio-runtime-worker pact_matching: comparing to expected HTTP Request ( method: GET, path: /, query: None, headers: None, body: Missing )
2022-10-24T01:10:41.895662Z  INFO tokio-runtime-worker pact_stub_server::pact_support: <=== Sending HTTP Response ( status: 200, headers: None, body: Present(31 bytes) )

Curl logs:

❯ curl -v http://127.0.0.0:33145/
*   Trying 127.0.0.0:33145...
* Connected to 127.0.0.0 (127.0.0.0) port 33145 (#0)
> GET / HTTP/1.1
> Host: 127.0.0.0:33145
> User-Agent: curl/7.81.0
> Accept: */*
> 
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< access-control-allow-origin: *
< content-type: application/json
< content-length: 31
< date: Mon, 24 Oct 2022 01:10:41 GMT
< 
* Connection #0 to host 127.0.0.0 left intact
{"payload":{"callback":"úrl"}}

@rholshausen
Copy link
Contributor

This may be an issue with your gateway

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

No branches or pull requests

2 participants