jhipster / generator-jhipster

JHipster is a development platform to quickly generate, develop, & deploy modern web applications & microservice architectures.
https://www.jhipster.tech
Apache License 2.0
21.54k stars 4.02k forks source link

ClientForwardController intercepts request but he should not #18039

Closed maiido closed 10 months ago

maiido commented 2 years ago

Hi,

I think, I found a minor issue in ClientForwardController. By the way JHipster rocks !

Overview of the issue
@GetMapping(value = "/**/{path:[^\\.]*}")

With that configuration of ClientForwardController,

And with a controller with this configuration

@RequestMapping("/api")

...

@GetMapping("/{one}/{two}/{three}/{four}/{five}") public ResponseEntity<String> getValue( @PathVariable(name = "one") int one, @PathVariable(name = "two") int two, @PathVariable(name = "three") int three, @PathVariable(name = "four") int four, @PathVariable(name = "five") int five ) { return ResponseEntity.ok("hello world"); }

With this request : http://localhost:8080/api/1/2/3/4/5

I don't enter into my function getValue, it's ClientForwardController which intercepts the request.

If i remove "five" pathVariable, I enter into the function getValue. a bit strange !

Suggest a Fix
@GetMapping(value = "/{path:[^\\.]*}")

Remove "/**" at start like the case communicationSpringWebsocket in ClientForwardController.java.ejs and getValue works with 5 pathVariable

mshima commented 2 years ago

Makes sense. @maiido can you create the PR?

maiido commented 2 years ago

the PR : https://github.com/jhipster/generator-jhipster/pull/18212

github-actions[bot] commented 10 months ago

This issue is stale because it has been open for too long without any activity. Due to the moving nature of jhipster generated application, bugs can become invalid. If this issue still applies please comment otherwise it will be closed in 7 days

mshima commented 10 months ago

ClientForwardController was replaced by a filter at JHipster 8