chore(deps): update dependency mockttp to v4 #357
+163
−18
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.




This PR contains the following updates:
^3.10.0→^4.0.0Release Notes
httptoolkit/mockttp (mockttp)
v4.2.1Compare Source
v4.2.0Compare Source
v4.1.0Compare Source
v4.0.2Compare Source
v4.0.1Compare Source
v4.0.0Compare Source
Notable changes
delay(X)step, which you can add to any rule to wait Xms before running the next step. More to come (open an issue with ideas!)socks: trueoption.passthrough: ['unknown-protocol']option. With this enabled, non-HTTP traffic will be recognized, and automatically proxied untouched through Mockttp to its destination. This is only possible when a connection destination is provided separately, with an HTTP or SOCKS tunnel (i.e. this isn't supported in direct connections). All proxied data is fully observable via the newraw-passthrough-*events.metadataand a password containing JSON like{"tags":["tag1", ...]}(255 character length limit). The password can be base64 encoded if required. SOCKS proxying also supports a custom authentication method (0xDA) to attach metadata to a connection without length limits, but this requires custom client support. The resulting data is available in thetagsfield of all request events and similar fired by this connection later.getRemoteor browser usage) no longer requires use ofhttp-encoding,zstd-codec,brotli-wasmor similar, simplifying many browser testing use cases. Instead all decoding is handled transparently on the server-side. Automatic encoding can also be disabled completely using the newmessageBodyDecoding: 'none'Mockttp client option, which will expose only encoded (or no-encoding-required) data and require you to manually handle encoded cases (throwing an error if you try to read encoded data without doing so).💥 Breaking changes
host/:authorityheader values if both are available but don't match. This could previously be inconsistent in some cases, but we now assume if you attempt to proxy to a server, then that's the 'real' destination, and this is reflected in theurlproperty and elsewhere.GET https://google.com) that don't create a separate tunnel.transfer-encodingandconnectionheaders. This will no longer be applied by default. If your request is already normal valid HTTP this will not cause a problem. If not (unlikely unless you're building HTTP requests without a proper client) then you will need to fix your request or use a beforeRequest callback to manually do so.thenForwardTowith abeforeRequestcallback. Internally, forwarding is now part of thetransformRequestoptions, which can't be used with the corresponding callback. Instead, return aurlfrom yourbeforeRequestcallback directly.simulateConnectionErrorsis set, like other connection issues (this was previously inconsistent for backward compatibility).connectHostname,connectPortandhostnameproperties have been removed as they were ambiguous. Instead depending on your use case you will want one of:event.destinationfor the tunnel target hostname & portevent.tlsMetadata.sniHostnamefor the servername specified in the TLS SNI extension.hostnamehas been removed from request & websocket events too, as it wasn't clear where this came from. Instead depending on your use case you will want one of:event.urlto get the effective URL of the requestevent.destinationto get the calculated destination of the request (this will be the tunnel destination if available, or value from the headers if not)event.headers['host'](HTTP/1.1) orevent.headers[':authority'](HTTP/2+) to get the host that's being requested in the HTTP request itselfgetRemoteor usage from a browser), all body content is now decoded on the server side, rather than within the client. This simplifies client setup significantly (e.g. brotli-wasm & associated setup is no longer required) and should be an invisible change in most cases, but could result in small differences in event delivery timing to the client as decoding must complete (or fail) before the event is delivered.generateCACertificatehas moved the subject-related options into a separatesubject: {}options field.BEGIN PRIVATE KEY, not PKCS#1 (BEGIN RSA PRIVATE KEY) as previously.server.addRequestRules({ matchers: [...], handler: ... }),setRequestRules, etc):handler: Xwithsteps: [X].requestStepsandwebSocketSteps, and 'Handler' has been replaced with 'Step' in all names. For example, you may want to usemockttp.requestSteps.PassThroughStepto define a passthrough proxy step.forwardingoption for passthrough rules has been migrated intotransformRequestas newsetProtocol,replaceHost,matchReplaceHost,matchReplacePathandmatchReplaceQueryoptions, providing far more powerful URL rewriting tools. For most simple cases, you can migrate by simply passing yourforwardingoption asreplaceHostinstead.SimpleHandleris nowFixedResponseHandlerSimplePathMatcheris nowFlexiblePathMatcherTlsRequest/HttpsOptions/HttpsPathOptionsare nowTlsHandshakeFailure/CertDataOptions/CertPathOptionsrespectively), the callbackstatusresult field (usestatusCodeinstead), thetrustAdditionalCAsoption (useadditionalTrustedCAsinstead), and the string format in thetrustedCAsproxy settings option for upstream proxying.Full Changelog: httptoolkit/mockttp@v3.17.1...v4.0.0
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.