use formedURL instead reqURL in http request dump message
@@ -425,6 +425,10 @@ func (request *Request) executeRequest(reqURL string, generatedRequest *generate
resp, err = request.httpClient.Do(generatedRequest.request)
}
}
+ // use request url as matched url if empty
+ if formedURL == "" {
+ formedURL = reqURL
+ }
// Dump the requests containing all headers
if !generatedRequest.original.Race {
@@ -435,7 +439,7 @@ func (request *Request) executeRequest(reqURL string, generatedRequest *generate
}
dumpedRequestString := string(dumpedRequest)
if request.options.Options.Debug || request.options.Options.DebugRequests || request.options.Options.StoreResponse {
- msg := fmt.Sprintf("[%s] Dumped HTTP request for %s\n\n", request.options.TemplateID, reqURL)
+ msg := fmt.Sprintf("[%s] Dumped HTTP request for %s\n\n", request.options.TemplateID, formedURL)
if request.options.Options.Debug || request.options.Options.DebugRequests {
gologger.Info().Msg(msg)
@@ -447,11 +451,6 @@ func (request *Request) executeRequest(reqURL string, generatedRequest *generate
}
}
- // use request url as matched url if empty
- if formedURL == "" {
- formedURL = reqURL
- }
-
if err != nil {
// rawhttp doesn't support draining response bodies.
if resp != nil && resp.Body != nil && generatedRequest.rawRequest == nil && !generatedRequest.original.Pipeline {
