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

Micronaut HttpRequest getUri() behaves different on Tomcat and Netty #298

Closed
3 of 4 tasks
martijndwars opened this issue Jul 22, 2021 · 0 comments · Fixed by #329
Closed
3 of 4 tasks

Micronaut HttpRequest getUri() behaves different on Tomcat and Netty #298

martijndwars opened this issue Jul 22, 2021 · 0 comments · Fixed by #329
Assignees
Labels
status: under consideration The issue is being considered, but has not been accepted yet

Comments

@martijndwars
Copy link

Task List

  • Steps to reproduce provided
  • Stacktrace (if present) provided
  • Example that reproduces the problem uploaded to Github
  • Full description of the issue provided (see below)

Steps to Reproduce

  1. Create a new Micronaut project: mn create-app -b gradle_kotlin micronaut-abc
  2. Make sure build.gradle.kts mentions runtime("tomcat")
  3. Add a controller:
package micronaut.abc;

import io.micronaut.http.HttpRequest;
import io.micronaut.http.annotation.Controller;
import io.micronaut.http.annotation.Get;

@Controller()
public class HelloController {

  @Get("hello")
  public String hello(HttpRequest<?> httpRequest) {
    return httpRequest.getUri().toString();
  }
}
  1. Request the page: curl "http://localhost:8080/hello?a=1&b=2"
  2. Change the runtime in build.gradle.kts from tomcat to netty.
  3. Restart the application, request the page again: curl "http://localhost:8080/hello?a=1&b=2"

Expected Behaviour

Both curl commands should output the same result: "hello?a=1&b=2"

Actual Behaviour

The first curl command (when using tomcat) returns "hello", the second curl command (when using netty) returns "hello?a=1&b=2".

Environment Information

  • Operating System: macOS 10.15.7
  • Micronaut Version: 2.5.8
  • JDK Version: 11
@graemerocher graemerocher added the status: under consideration The issue is being considered, but has not been accepted yet label Oct 16, 2021
@yawkat yawkat transferred this issue from micronaut-projects/micronaut-core Apr 1, 2022
n0tl3ss added a commit to n0tl3ss/micronaut-servlet that referenced this issue May 17, 2022
yawkat pushed a commit that referenced this issue May 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: under consideration The issue is being considered, but has not been accepted yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants