Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spliting dump request to add Query 馃悰 馃毄 #1909

Merged
merged 1 commit into from Jun 12, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions app.go
Expand Up @@ -9,6 +9,7 @@ package fiber

import (
"bufio"
"bytes"
"crypto/tls"
"crypto/x509"
"errors"
Expand Down Expand Up @@ -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(" "))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please improve this construct with regard to performance and allocations

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will take a better a look on this. The problem is: imagine you have a query /foo?bar=boo, when the dump is create the query part is removed, staying /foo.

dumps[1] = []byte(req.URL.String())
dump = bytes.Join(dumps, []byte(" "))

// Create test connection
conn := new(testConn)

Expand Down