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

Conversation

ancogamer
Copy link
Contributor

@ancogamer ancogamer commented May 16, 2022

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.

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.
@ReneWerner87
Copy link
Member

ReneWerner87 commented May 17, 2022

hi thanks for the work

is this not already possible, just trying to understand what your customization is supposed to do

can you explain this in more detail and if necessary send an example, which shows what was not possible before and is now possible

@ReneWerner87
Copy link
Member

ReneWerner87 commented May 17, 2022

think i now understand the point of this pull requests

nevertheless please describe briefly in the pull request with an example, what is possible now, what did not work before

so that we have this stored here for later

can you please also extend the test with such a case
in: https://github.com/gofiber/fiber/blob/master/app_test.go

@@ -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

@ReneWerner87 ReneWerner87 May 17, 2022

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

@ancogamer ancogamer May 17, 2022

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.

@ReneWerner87 ReneWerner87 merged commit 4d65e88 into gofiber:master Jun 12, 2022
16 checks passed
trim21 pushed a commit to trim21/fiber that referenced this issue Aug 15, 2022
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants