Path parameter encoding in client and controller #3967
-
| 
         Hi, I'm developing a file browser type of controller and I'm confused about path encoding when using {+path} syntax in the controller and client. I made a test application that exercises a few request variants. https://github.com/goeh/micronaut-url-encoding-issue @Client("/")
public interface TestClient {
    @Get("{path}")
    String standard(String path);
    @Get("{+path}")
    String includeReservedChars(String path);
}
@Controller("/")
public class TestController {
    @Get(value = "/{+path}", produces = MediaType.TEXT_PLAIN)
    public String test(String path) {
        return path;
    }
}Most of the test results makes sense but I was surprised that character encoding got disabled/wrong when using {+path} on the declarative client. For example "/foo/bar/göran.txt" results in "/foo/bar/göran.txt". My findings resulted in that I should not use {+path} on the client side, only on the server/controller side. Is Micronaut doing everything correct here? I'm using Micronaut 1.3.7  | 
  
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
| 
         Could be a bug, be the encoding used to parse the path parameters. Maybe worthy of an issue report  | 
  
Beta Was this translation helpful? Give feedback.
Could be a bug, be the encoding used to parse the path parameters. Maybe worthy of an issue report