github unkn0wn-root/resterm v1.18.3

33 minutes ago

Streams

An @sse or @websocket request used to pass as long as the server answered at all. Say your order feed needs a token, and that token has expired:

### Order events
# @name events
# @sse
GET http://localhost:8787/orders/events

The server replies 401 and no stream ever starts. Older versions reported a pass:

PASS SSE events [401 Unauthorized in 25.137625ms]

This release fails the request with exit code 26:

FAIL SSE events [sse stream not opened: 401 Unauthorized]

You still get the server's answer, body included. An SSE stream opens only on a 200 with the text/event-stream content type, a WebSocket only on an upgrade. Captures and asserts don't run on a refused answer.

A stream can also start fine and die later: the connection drops, a line is too long, the run times out. On its own, such a request already failed. A profile around it didn't:

### Price feed
# @name feed
# @profile count=3
# @sse
GET http://localhost:8787/prices/stream

This feed drops after two events, every time. Previous versions counted three good runs:

PASS PROFILE feed [3 total, 3 success, 0 failure in 346.1395ms]

Now all three count as failures, and so does the profile:

FAIL PROFILE feed [3 total, 0 success, 3 failure in 339.3635ms]

Other places follow the same rule:

  • A workflow stops at the step whose stream broke. The next step used to be sent anyway.
  • @for-each ends at that item, and a compare row is marked as failed.
  • The default output and JUnit name the stream error. You only saw 200 OK there.
  • An SSE duration that runs out before the server answers is a timeout with exit code 20, not 21.

The streaming page lists every such failure with its exit code.

curl import

--from-curl and inline curl import read a command more like curl does:

  • An empty quoted value stays an argument. curl -X POST -d '' https://api.example.com/orders came back with curl command missing URL. It imports as a POST with an empty body, and -A '' or -x '' no longer trip the import either.
  • Several -b values end up in one Cookie header. Only the last one made it through.
  • -b cookies.txt means a cookie file, as in curl. Resterm skips it with a warning and no longer sends Cookie: cookies.txt.
  • A header given with -H wins over -A, -e and -b.

User-Agent

A request that doesn't set User-Agent goes out as resterm/<version> (example: resterm/1.18.3). Until now it used Go's default, Go-http-client/1.1. Details are on the HTTP settings page.

Smaller changes

  • The output of a single request missed two places when masking secrets: the summary of a stream and the status line of a gRPC call. Status: PermissionDenied (bad token ord_tok_7f3a91c2e5) is printed as Status: PermissionDenied (bad token •••).
  • The install scripts have a shorter address: curl -fsSL https://resterm.app/install.sh | sh, or irm https://resterm.app/install.ps1 | iex on Windows.

Upgrading

  1. Look for CI jobs that point @sse or @websocket at an endpoint that answers without a stream.
  2. Check profiles, workflows and @for-each loops that sit on a stream.
  3. If a server rule or log filter matches Go-http-client, switch it to resterm/, or set a User-Agent header in the request.
  4. Import curl commands again if they used -b more than once or with a file name.

Coming from something older than 1.18.2? Read the 1.18.2 and 1.18.1 notes.

Don't miss a new resterm release

NewReleases is sending notifications on new releases.