Skip to content

include address of remote peer in RequestInfo#651

Merged
davepacheco merged 2 commits intomainfrom
remote-address
Apr 18, 2023
Merged

include address of remote peer in RequestInfo#651
davepacheco merged 2 commits intomainfrom
remote-address

Conversation

@jclulow
Copy link
Copy Markdown
Collaborator

@jclulow jclulow commented Apr 17, 2023

This is an attempt to fix #316.

Copy link
Copy Markdown
Collaborator

@davepacheco davepacheco left a comment

Choose a reason for hiding this comment

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

Thanks for doing this. Would you mind just adding a test somewhere? (I would hope this could be just a few lines in some existing test that just verifies that the address returned by the new function matches the address of the client that we used to make the request. I know it'll be loopback anyway so it's not the most interesting test. But the port numbers should match up and that'll make sure we're grabbing the right thing, both now and if things change in the future.)

Comment thread dropshot/src/handler.rs Outdated
@jclulow
Copy link
Copy Markdown
Collaborator Author

jclulow commented Apr 18, 2023

Thanks for doing this. Would you mind just adding a test somewhere? (I would hope this could be just a few lines in some existing test that just verifies that the address returned by the new function matches the address of the client that we used to make the request. I know it'll be loopback anyway so it's not the most interesting test. But the port numbers should match up and that'll make sure we're grabbing the right thing, both now and if things change in the future.)

I added a test! Let me know if it is what you had in mind, or if you would like something different.

Copy link
Copy Markdown
Collaborator

@davepacheco davepacheco left a comment

Choose a reason for hiding this comment

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

This looks great. Thanks. (Too bad we can't get the client port out, but I guess it's possible it's not determined until we make the request and even then could be transient.)

I'd also like to add a changelog entry. I did that in #652. That PR targets this branch right now. So we could either land that into this PR and then land this PR, or else we could land this PR as-is and then land that PR into "main". Either way's fine with me.

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.

RequestContext should expose remote address of connection

2 participants