Skip to content
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

Is it correct that the pattern includes port? #44

Closed
naivefun opened this issue Jun 16, 2017 · 3 comments
Closed

Is it correct that the pattern includes port? #44

naivefun opened this issue Jun 16, 2017 · 3 comments

Comments

@naivefun
Copy link

naivefun commented Jun 16, 2017

I tested the sample example, it seems that a.abc.org:8080 does not match **.abc.org. Is that supposed behavior?
However **.abc.org:* matches.

@spencergibb
Copy link
Member

the pattern doesn't match. How did you test it?

@naivefun
Copy link
Author

naivefun commented Jun 17, 2017

I added test into RoutePredicatesTest and it passes:

@Test
public void testHostPredicates() {
	assertThat(host("**").test(mockHostExchange("test.abc.com"))).isTrue();
	assertThat(host("**.abc.**").test(mockHostExchange("test.abc.com"))).isTrue();
	assertThat(host("**.co?").test(mockHostExchange("test.abc.com"))).isTrue();
	assertThat(host("**.co").test(mockHostExchange("test.abc.com"))).isFalse();
	assertThat(host("**.abc.org:*").test(mockHostExchange("www.abc.org:8080"))).isTrue();
	assertThat(host("**.abc.org").test(mockHostExchange("www.abc.org:8080"))).isFalse();
}

I believe that the Host is parsed with port so this is fine. But if there is PortPredicates it makes sense as well?

@spencergibb
Copy link
Member

I think this is working properly.

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

No branches or pull requests

2 participants