[x] Close all idle connections in the resource pool onResponse()
WHY?: During testRequestCookies(), the server determines the requests only by binding on the socket. And, OkHttp never frees or closes connections for all enqueue() calls. This led to the server assuming multiple requests as a single entity (as OkHttp never stopped communicating with the socket,) and parsing both cookie headers as one. This gave a cookies list with a length of 2, which failed the 2nd test case multiple cookies semicolon separated. By explicitly closing idle connections, we protect consecutive requests from being overlapped.
[x] Add testRequestCookies()
[x] Add testResponseHeaders() since all TCs are passing now that #1219 is closed (see #1222)
[x] I’ve reviewed the contributor guide and applied the relevant portions to this PR.
Contribution guidelines:
- See our [contributor guide](https://github.com/dart-lang/.github/blob/main/CONTRIBUTING.md) for general expectations for PRs.
- Larger or significant changes should be discussed in an issue before creating a PR.
- Contributions to our repos should follow the [Dart style guide](https://dart.dev/guides/language/effective-dart) and use `dart format`.
- Most changes should add an entry to the changelog and may need to [rev the pubspec package version](https://github.com/dart-lang/sdk/wiki/External-Package-Maintenance#making-a-change).
- Changes to packages require [corresponding tests](https://github.com/dart-lang/.github/blob/main/CONTRIBUTING.md#Testing).
Note that many Dart repos have a weekly cadence for reviewing PRs - please allow for some latency before initial review feedback.
Items in this PR:
okhttp3.ConnectionPool
(allows us to use the [evictAll()
](https://square.github.io/okhttp/5.x/okhttp/okhttp3/-connection-pool/evict-all.html?query=fun%20evictAll()) method)onResponse()
testRequestCookies()
, the server determines the requests only by binding on the socket. And, OkHttp never frees or closes connections for allenqueue()
calls. This led to the server assuming multiple requests as a single entity (as OkHttp never stopped communicating with the socket,) and parsing bothcookie
headers as one. This gave a cookies list with a length of 2, which failed the 2nd test casemultiple cookies semicolon separated
. By explicitly closing idle connections, we protect consecutive requests from being overlapped.testRequestCookies()
testResponseHeaders()
since all TCs are passing now that #1219 is closed (see #1222)Contribution guidelines:
- See our [contributor guide](https://github.com/dart-lang/.github/blob/main/CONTRIBUTING.md) for general expectations for PRs. - Larger or significant changes should be discussed in an issue before creating a PR. - Contributions to our repos should follow the [Dart style guide](https://dart.dev/guides/language/effective-dart) and use `dart format`. - Most changes should add an entry to the changelog and may need to [rev the pubspec package version](https://github.com/dart-lang/sdk/wiki/External-Package-Maintenance#making-a-change). - Changes to packages require [corresponding tests](https://github.com/dart-lang/.github/blob/main/CONTRIBUTING.md#Testing). Note that many Dart repos have a weekly cadence for reviewing PRs - please allow for some latency before initial review feedback.