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

Add option for middleware to set custom remote address #1009

Merged
merged 2 commits into from
Apr 23, 2021
Merged

Add option for middleware to set custom remote address #1009

merged 2 commits into from
Apr 23, 2021

Conversation

lafriks
Copy link
Contributor

@lafriks lafriks commented Apr 21, 2021

Fixes #1008

@lafriks
Copy link
Contributor Author

lafriks commented Apr 21, 2021

lint failure does not seem to be related to my PR :)

Copy link
Collaborator

@erikdubbelboer erikdubbelboer left a comment

Choose a reason for hiding this comment

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

It's probably best to also set ctx.remoteAddr = nil in RequestCtx.Init2.

@lafriks
Copy link
Contributor Author

lafriks commented Apr 23, 2021

It's probably best to also set ctx.remoteAddr = nil in RequestCtx.Init2.

ok, will add. Should I remove that from releaseCtx?

@erikdubbelboer
Copy link
Collaborator

No keep it there as well as the normal flow doesn't use Init.

@lafriks
Copy link
Contributor Author

lafriks commented Apr 23, 2021

@erikdubbelboer fixed

@erikdubbelboer erikdubbelboer merged commit 620f0c8 into valyala:master Apr 23, 2021
@erikdubbelboer
Copy link
Collaborator

Thanks!

@lafriks lafriks deleted the feat/custom_remote_addr branch April 24, 2021 09:56
@lafriks
Copy link
Contributor Author

lafriks commented Apr 24, 2021

Thanks for prompt review

@lafriks
Copy link
Contributor Author

lafriks commented Apr 26, 2021

would be nice to tag version so that it would be easier to use it :)

@erikdubbelboer
Copy link
Collaborator

Done

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

Successfully merging this pull request may close these issues.

Add option to set value of RemoteAddr/RemoteIP by middleware
2 participants