Skip to content

Fix a range check when extracting a virtual host in RabbitProperties - #2944

Closed
izeye wants to merge 1 commit into
spring-projects:masterfrom
izeye:patch-9
Closed

izeye wants to merge 1 commit into
spring-projects:masterfrom
izeye:patch-9

Conversation

@izeye

@izeye izeye commented May 14, 2015

Copy link
Copy Markdown
Contributor

No description provided.

@philwebb philwebb added this to the 1.2.5 milestone Jun 17, 2015
@philwebb philwebb added the type: bug A general bug label Jun 17, 2015
@philwebb

Copy link
Copy Markdown
Member

We could also do with a test when we merge this

@wilkinsona wilkinsona self-assigned this Jun 22, 2015
@wilkinsona

Copy link
Copy Markdown
Member

@izeye. Thanks for the PR, but I don't think the range check is a problem. If the address ends with / the substring call successfully produces an empty string. With the change proposed here, the substring never happens and the / is left on the end of the address. This can result in a NumberFormatException when attempting to parse the port.

I think what needs to happen is for the empty string to be mapped to a /. This would make the behaviour consistent with setVirtualHost. I've opened #3304.

@wilkinsona wilkinsona closed this Jun 22, 2015
@wilkinsona wilkinsona removed this from the 1.2.5 milestone Jun 22, 2015
@philwebb philwebb added status: invalid An issue that we don't feel is valid and removed type: bug A general bug labels Jun 23, 2015
@garyrussell

garyrussell commented Jun 25, 2015 •

Copy link
Copy Markdown
Contributor

@wilkinsona @philwebb Please note that, since e3a124d , it's no longer necessary for boot to parse the URI - since the RabbitConnectionFactoryBean exposes a setUri() method, the URI can be passed directly to Rabbit and it will parse it. cc/ @snicoll

@wilkinsona

Copy link
Copy Markdown
Member

Thanks for the tip, @garyrussell. I've opened #3328.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: invalid An issue that we don't feel is valid

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants