You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I'm trying to add RewriteLocationResponseHeader filter to my application.yml route definition. I'm using the format given in the documentation:
Caused by: java.lang.IllegalArgumentException:
Unable to find operation interface org.springframework.web.servlet.function.HandlerFilterFunction for
rewriteLocationResponseHeader with args {_genkey_0=AS_IN_REQUEST, _genkey_1=Location}
I cannot, for the life of me, figure out how to tell it to use default values for the last two parameters. I've tried:
RewriteLocationResponseHeader=AS_IN_REQUEST, Location, '', '': this ended up creating a string containing ''.
RewriteLocationResponseHeader=AS_IN_REQUEST, Location, "", "": this ended up creating a string containing "".
RewriteLocationResponseHeader=AS_IN_REQUEST, Location, {}, {}: this ended up creating a string containing {}.
It seems as the code handling the extraction of parameters to the filter does not correctly handle empty strings. Or something along those lines.
The question is: How am I supposed to specify empty strings in app yaml to RewriteLocationResponseHeader?
Sample
I've forked the excellent demo by eyal33 which can be used to demo it. You don't need to setup any Docker stuff, just try to run the app, and the RewriteLocationResponseHeader line will take care of application startup failing.
I'm not sure if there is a shortcut bug, or just bad documentation. Did you try it without the last two arguments? (my guess is you get the same error)
I don't know if an empty string to hostValue is a good idea as RewriteLocationResponseHeaderFilterFunctions#rewriteLocationResponseHeader checks for a null value and an empty field in YAML will be converted, to my understanding, to an empty string. Please see
Describe the bug
I'm trying to add
RewriteLocationResponseHeader
filter to my application.yml route definition. I'm using the format given in the documentation:However, the app startup fails with:
I cannot, for the life of me, figure out how to tell it to use default values for the last two parameters. I've tried:
RewriteLocationResponseHeader=AS_IN_REQUEST, Location, '', ''
: this ended up creating a string containing''
.RewriteLocationResponseHeader=AS_IN_REQUEST, Location, "", ""
: this ended up creating a string containing""
.RewriteLocationResponseHeader=AS_IN_REQUEST, Location, {}, {}
: this ended up creating a string containing{}
.It seems as the code handling the extraction of parameters to the filter does not correctly handle empty strings. Or something along those lines.
The question is: How am I supposed to specify empty strings in app yaml to
RewriteLocationResponseHeader
?Sample
I've forked the excellent demo by eyal33 which can be used to demo it. You don't need to setup any Docker stuff, just try to run the app, and the
RewriteLocationResponseHeader
line will take care of application startup failing.The sample application: https://github.com/kontza/spring-cloud-gateway-mvc-demo
The text was updated successfully, but these errors were encountered: