Skip to content

Remove '\n' from Access refused stomp log. #8462

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

Merged
merged 1 commit into from
Jun 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion deps/rabbitmq_stomp/src/rabbit_stomp_processor.erl
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@ do_login(Username, Passwd, VirtualHost, Heartbeat, AdapterInfo, Version,
{error, {auth_failure, _}} ->
rabbit_log:warning("STOMP login failed for user '~ts': authentication failed", [Username]),
error("Bad CONNECT", "Access refused for user '" ++
binary_to_list(Username) ++ "'~n", [], State);
binary_to_list(Username) ++ "'", [], State);
{error, not_allowed} ->
rabbit_log:warning("STOMP login failed for user '~ts': "
"virtual host access not allowed", [Username]),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@ def test_unsupported_version(self):

def test_bad_username(self):
''' Test bad username'''
self.bad_connect("Access refused for user 'gust'\n", user='gust')
self.bad_connect("Access refused for user 'gust'", user='gust')

def test_bad_password(self):
''' Test bad password'''
self.bad_connect("Access refused for user 'guest'\n", passcode='gust')
self.bad_connect("Access refused for user 'guest'", passcode='gust')

def test_bad_vhost(self):
''' Test bad virtual host'''
Expand Down Expand Up @@ -132,4 +132,4 @@ def test_disconnect_with_receipt(self):
modules = [
__name__
]
test_runner.run_unittests(modules)
test_runner.run_unittests(modules)
2 changes: 1 addition & 1 deletion deps/rabbitmq_web_stomp/test/cowboy_websocket_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ connection_fails(Config) ->
WS = rfc6455_client:new(Protocol ++ "://127.0.0.1:" ++ PortStr ++ "/ws", self()),
{ok, _} = rfc6455_client:open(WS),
ok = raw_send(WS, "CONNECT", [{"login", "uncorrect_$55"}, {"passcode", "uncorrect_$88"}]),
{<<"ERROR">>, _, <<"Access refused for user 'uncorrect_$55'\n">>} = raw_recv(WS),
{<<"ERROR">>, _, <<"Access refused for user 'uncorrect_$55'">>} = raw_recv(WS),
{close, _} = rfc6455_client:close(WS),
ok.

Expand Down