httpexpect
httpexpect copied to clipboard
fix: preserve query from RequestFactory
httpexpect.Request holds a copy of query in r.query, but fails to copy/sync the query set in the RequestFactory.
I also tried to write a test for TestExpect_RequestFactory, but it is not easy because encodeRequest is not called there and this code is never executed:
func (r *Request) encodeRequest(opChain *chain) bool {
r.httpReq.URL.Path = concatPaths(r.httpReq.URL.Path, r.path)
if r.query != nil {
r.httpReq.URL.RawQuery = r.query.Encode() <--- here the query is overriden
}