Repository navigation
Conversation
philwebb
force-pushed
the
fix-rabbit-uri-decode-without-port
branch
2 times, most recently
from
November 12, 2026 22:11
60ee1fb to
0e1adc0
Compare
Update `RabbitUri` to also decode relevant parts of the URI when no port is specified. See spring-projectsgh-52644 Signed-off-by: zhoubiao188 <[email protected]>
philwebb
force-pushed
the
fix-rabbit-uri-decode-without-port
branch
from
November 12, 2026 22:15
0e1adc0 to
9fe6bea
Compare
Member
|
Thanks @zhoubiao188! |
This was referenced Nov 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
RabbitUri.ofonly decodes percent-encoded values in the branch that parses an explicit port:As a result, an address that omits the port (and therefore uses the default one) is not decoded, even though the scheme and port are both optional in an AMQP URI:
Adding
:5672to the same address givesus:er,p@ssandmy/vhost, so the connection authenticates only when the port happens to be written out. This is the same failure that #52623 describes, and it also affects the default virtual host written as%2F(amqp://localhost/%2Fcurrently yields the virtual host%2F).This commit decodes the values right after they have been split off, before the host and port are parsed, so that both paths construct the record with the same values. Splitting still happens on the encoded form, so an encoded
@,:or/keeps working as a delimiter and+is still preserved byStringUtils.uriDecode.Three tests have been added: credentials and virtual host without a port, and the encoded default virtual host
without a port, both of which fail before the change and pass after it, plus
+preservation without a port,which fails if the no-port path ever stops using the same decoder as the other one.
Note for the merge forward:
RabbitUriwas duplicated onmainwhen the RabbitMQ modules were split, inspring-boot-amqp-rabbitmqandspring-boot-rabbitmq. Both copies contain the same branch and need the same change.