The current implementation of UriMatchTemplate only supports relative URIs:
String urlFormat = "/post/{+postSlug}";
UriMatchTemplate template = UriMatchTemplate.of(urlFormat);
// will return: Optional[/post/abc]
Optional<UriMatchInfo> match = template.match("/post/abc");
But if change urlFormat to the absolute URI template, it will not work as expected:
String urlFormat = "https://www.mydomain.com/post/{+postSlug}";
UriMatchTemplate template = UriMatchTemplate.of(urlFormat);
// will return: Optional.empty
Optional<UriMatchInfo> match = template.match("https://www.mydomain.com/post/abc");
Hi! If there is no one working on this I would like to tackle it.
Sounds great!
@preyest1300 Wow!!! Thank you so much!!!
Hi Guys.
I think I have solved this issue. Below is the output after I made changes.
> Task :http:uriMatchTemplateTest.main()
Optional[/post/abc]
Optional[https://www.mydomain.com/post/abc]
Is this what you are expecting for this issue.
Thanks
Lovepreet Singh
Yes, looks correct.
Sounds good then. I will create a PR for this issue. But do I need to write groovy test case, as I don't saw any junit test cases for this project.
@loveshah751 thank you!