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

Fix issue with root routing + improve tests #11123

Merged
merged 5 commits into from
Aug 29, 2024
Merged

Fix issue with root routing + improve tests #11123

merged 5 commits into from
Aug 29, 2024

Conversation

dstepanov
Copy link
Contributor

@dstepanov dstepanov commented Aug 27, 2024

Fixes #11122

Included @Requires(property to all the controllers in Netty Server tests to make debugging easier, added a test to fail if somebody adds a not-property-hidden controller.

@graemerocher
Copy link
Contributor

should there be an HTTP TCK test for the root mapping thing?

@dstepanov
Copy link
Contributor Author

Added

@@ -68,7 +68,7 @@ private UriTemplateMatcher(String templateString, List<UriTemplateParser.Part> p
this.parts = parts;
List<UriMatchVariable> variables = new ArrayList<>();
this.segments = provideMatchSegments(parts, variables);
this.isRoot = segments.length == 0 || segments[0].type == SegmentType.LITERAL && isRoot(segments[0].value);
this.isRoot = segments.length == 0 || segments.length == 1 && segments[0].type == SegmentType.LITERAL && isRoot(segments[0].value);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
this.isRoot = segments.length == 0 || segments.length == 1 && segments[0].type == SegmentType.LITERAL && isRoot(segments[0].value);
this.isRoot = segments.length == 0 || (segments.length == 1 && segments[0].type == SegmentType.LITERAL && isRoot(segments[0].value));

Copy link

sonarcloud bot commented Aug 28, 2024

@dstepanov dstepanov merged commit 713ff1c into 4.6.x Aug 29, 2024
17 checks passed
@dstepanov dstepanov deleted the rout branch August 29, 2024 06:40
altro3 pushed a commit to altro3/micronaut-core that referenced this pull request Aug 31, 2024
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

Successfully merging this pull request may close these issues.

Wrong route matched when http request to /
3 participants