perwendel / spark

A simple expressive web framework for java. Spark has a kotlin DSL https://github.com/perwendel/spark-kotlin
Apache License 2.0
9.63k stars 1.56k forks source link

Redirect of POST request is getting as GET request which cause issue #1277

Open hairshkumar opened 1 year ago

hairshkumar commented 1 year ago

Hi Team,

am using redirect.post("/variable", "/:region/variable"); to redirect variable to new variable endpoint. but getting below error. Even the new url is there which is POST endpoint is working.

6894 [qtp1340842603-23] INFO spa.htt.mat.MatcherFilter - The requested route [/:region/variable] has not been mapped in Spark for Accept: [/]

Found that redirect internal assigned HTTP method to GET instead of POST due to which the new URL is not being found

21316 [qtp79709097-29] INFO Received request with region: path=http://localhost:4567/:region/variable, method=GET, region=:region attributes =null

Please help me which is the issue and why HTTP GET is used instead of POST when am trying to redirect POST endpoint.

SoltauFintel commented 1 year ago

Are you sure? Which version do you use?