Spliting dump request to add Query (#1909)

Spliting []dump into dumps, and editing the dump[1] to = req.URL.String(), so we can tests itens that depends on querys from the request.
pull/1943/head
João Vitor 2022-06-12 13:33:01 -03:00 committed by GitHub
parent 3bb4b7ed41
commit 4d65e88a2c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

6
app.go
View File

@ -9,6 +9,7 @@ package fiber
import (
"bufio"
"bytes"
"crypto/tls"
"crypto/x509"
"errors"
@ -974,6 +975,11 @@ func (app *App) Test(req *http.Request, msTimeout ...int) (resp *http.Response,
return nil, err
}
// adding back the query from URL, since dump cleans it
dumps := bytes.Split(dump, []byte(" "))
dumps[1] = []byte(req.URL.String())
dump = bytes.Join(dumps, []byte(" "))
// Create test connection
conn := new(testConn)