Skip to content

fix core: use peer address for websocket client connections#1276

Open
seriouscoder43 wants to merge 1 commit into
userver-framework:developfrom
seriouscoder43:fix-ws
Open

fix core: use peer address for websocket client connections#1276
seriouscoder43 wants to merge 1 commit into
userver-framework:developfrom
seriouscoder43:fix-ws

Conversation

@seriouscoder43

Copy link
Copy Markdown
Contributor

MakeWebsocketConnection() incorrectly uses Getsockname() to save the remote peer. Then connection's RemoteAddr() becomes always wrong

async def test_client(service_client, service_port, test_name):
response = await service_client.get(
'/test-client',
params={'test': test_name, 'port': service_port},

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

But the service_port is the port of the server that is written in userver. It makes the remote_port == port ? "OK" check wrong

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

No. For websockets tests the service connects a client to the server_port it also owns. test_client only initiates that run here. Do you want me to write a separate test case instead?

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.

2 participants