apache / apisix-java-plugin-runner

APISIX Plugin Runner in Java
https://apisix.apache.org/
Apache License 2.0
129 stars 95 forks source link

help request: Setting response statuscode in java plugin runner fails #174

Closed wodingyang closed 2 years ago

wodingyang commented 2 years ago

Description

Want to use java plugin to do redirection,code: image Return an error after requesting routing, check the log image The request is not redirected but the request goes upstream

Environment

tzssangglass commented 2 years ago

response.setPath is an incorrect usage and does not return the redirect address to the client.

we should use response.setHeader() like:

response.setHeader("Location", "/rjsp/check/123")

ref: https://github.com/apache/apisix-java-plugin-runner/blob/main/docs/en/latest/development.md

wodingyang commented 2 years ago

thank you!