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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request.QueryParameter function consumes large memory for big request #510

Closed
wofanli opened this issue Sep 22, 2022 · 3 comments
Closed

Comments

@wofanli
Copy link

wofanli commented Sep 22, 2022

I try to process query parameters before the whole HTTP request body are well-received in server. However, looks like Request.QueryParameter would wait for the whole HTTP request body.

func (r *Request) QueryParameter(name string) string {
return r.Request.FormValue(name)
}

Could we replace this function with something like: r.Request.URL.Query()[name][0]?

@emicklei
Copy link
Owner

hi, thank you for reporting this. I will have a look at this issue.

@emicklei
Copy link
Owner

can you verify the fix @wofanli so this can be closed ?

@wofanli
Copy link
Author

wofanli commented Oct 10, 2022

@emicklei That fix looks good to me. Thanks.

@wofanli wofanli closed this as completed Oct 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants