Hello everyone, I'm new to CDCT with Pact. I haven...
# pact-js
s
Hello everyone, I'm new to CDCT with Pact. I haven't found any information in the docs regarding the interaction with
status: 100-199
. Does Pact handle interactions with 100-199 status codes?
I've tried 'status: 100' within an interaction and checked the response of the mock server.
Copy code
.willRespondWith({
        status: 150,
        headers: {
          'Content-Type': 'application/json',
        },
        body: expectedMessage,
      });
Mock server response:
Copy code
Response {
  [Symbol(realm)]: null,
  [Symbol(state)]: {
    aborted: false,
    rangeRequested: false,
    timingAllowPassed: true,
    requestIncludesCredentials: true,
    type: 'default',
    status: 500,
...
m
Actually it doesn’t look like
1xx
are supported by the underlying infrastructure: https://github.com/hyperium/hyper/issues/2565
👀 1
If you wanted to raise the issue, it would go here: https://github.com/pact-foundation/pact-reference
s
Thanks for your reply! Here are logs though:
Copy code
2024-04-16T20:51:24.471821Z  WARN tokio-runtime-worker encode_headers: hyper::proto::h1::role: response with 1xx status code not supported
2024-04-16T20:51:24.471868Z DEBUG tokio-runtime-worker hyper::proto::h1::io: flushed 94 bytes
2024-04-16T20:51:24.471882Z TRACE tokio-runtime-worker hyper::proto::h1::conn: State::close()
2024-04-16T20:51:24.471892Z TRACE tokio-runtime-worker hyper::proto::h1::conn: flushed({role=server}): State { reading: Closed, writing: Closed, keep_alive: Disabled, error: hyper::Error(User(UnsupportedStatusCode)) }
m
Following up on this, what’s the use case around the status codes. 150 is not a code I’m aware of - is this a custom status code your server is sending?