You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug(Conformance): a client that rewrites the request URL (mapRequest) is read as a transport-followed redirect #359
A regression from #355, found in its post-merge review.
Problem
#355 treats a request the transport ended somewhere other than where the kit sent it as "a redirect the transport followed itself". The check compares the final request against the kit's own sent request, in src/internal/conformance/core.ts ~L771-786. That also catches a client that rewrites the URL with no redirect anywhere, e.g. HttpClient.mapRequest(client, (r) => HttpClientRequest.setUrl(r, …)) mapping baseUrl: "http://api.invalid" to a local port.
On trunk with that client: 51 rules are Skipped, and spec/target/reachableFails with "hand the kit a client that does not follow redirects itself". That is a false finding, and its remedy is wrong.
Compare the final request against client.preprocess(request), i.e. the request after any mapRequest, rather than against the kit's sent. In effect 4.0.0, mapRequest composes into preprocess, while followRedirects runs in postprocess, so this separates rewriting from following.
Add a test with a mapRequest that rewrites the origin. List origin-rewriting clients among the documented cases in docs/conformance.md §1.2.
Done when
A URL-rewriting client is read normally, with no skip and no reachable finding.
Activity
fix(conformance): run each request through the client as its execute …