mirror of
https://github.com/square/okhttp.git
synced 2025-11-05 12:17:34 +08:00
Fix breaking change from alpha.17 release (#8899)
The semantics of the old path property included the query string, and should be mapped from the new `target` which is the equivalent field in the new recorded request. Using url.encodedPath only provides the path component and omits the query component, resulting in a breaking change.
This commit is contained in:
committed by
GitHub
parent
75661d41cd
commit
dcb640c3da
@@ -112,7 +112,7 @@ internal fun mockwebserver3.RecordedRequest.unwrap(): RecordedRequest =
|
||||
sequenceNumber = exchangeIndex,
|
||||
failure = failure,
|
||||
method = method,
|
||||
path = url.encodedPath,
|
||||
path = target,
|
||||
handshake = handshake,
|
||||
requestUrl = url,
|
||||
)
|
||||
|
||||
@@ -513,6 +513,7 @@ class MockWebServerTest {
|
||||
assertThat(request.requestLine).isEqualTo(
|
||||
"GET /a/deep/path?key=foo%20bar HTTP/1.1",
|
||||
)
|
||||
assertThat(request.path).isEqualTo("/a/deep/path?key=foo%20bar")
|
||||
val requestUrl = request.requestUrl
|
||||
assertThat(requestUrl!!.scheme).isEqualTo("http")
|
||||
assertThat(requestUrl.host).isEqualTo(server.hostName)
|
||||
|
||||
Reference in New Issue
Block a user