Skip to content

Commit 78136cd

Browse files
authored
Send a print out original path of request (istio#32152)
Avoid golang processing the URL which limits our ability to tests non-standard clients.
1 parent 1f688a6 commit 78136cd

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

pkg/test/echo/server/endpoint/http.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,8 @@ func (h *httpHandler) addResponsePayload(r *http.Request, body *bytes.Buffer) {
302302
writeField(body, response.ServiceVersionField, h.Version)
303303
writeField(body, response.ServicePortField, port)
304304
writeField(body, response.HostField, r.Host)
305-
writeField(body, response.URLField, r.URL.String())
305+
// Use raw path, we don't want golang normalizing anything since we use this for testing purposes
306+
writeField(body, response.URLField, r.RequestURI)
306307
writeField(body, response.ClusterField, h.Cluster)
307308
writeField(body, response.IstioVersionField, h.IstioVersion)
308309

pkg/test/echo/server/forwarder/http.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ func (c *httpProtocol) makeRequest(ctx context.Context, req *request) (string, e
7272
if err != nil {
7373
return "", err
7474
}
75+
// Use raw path, we don't want golang normalizing anything since we use this for testing purposes
76+
httpReq.URL.Opaque = httpReq.URL.RawPath
7577

7678
// Set the per-request timeout.
7779
ctx, cancel := context.WithTimeout(ctx, req.Timeout)

0 commit comments

Comments
 (0)