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
Since the modification of HTTP Headers in 3.15.x, accessing a header through a groovy script via request.headers.'My-Header' will return a string instead of an array of values, meaning it becomes impossible to do array operation (join for example).
🌄 To Reproduce
Steps to reproduce the behaviour:
Add a groovy script to your policy and use:
if (request.headers.containsKey('test')) {
userAgent = request.headers.'test'.join('|');
request.headers.'test2'= userAgent;
}
It should fail with
22:05:55.485 \[vert.x-eventloop-thread-1\] \[\] ERROR i.g.policy.groovy.GroovyPolicy - Unable to run Groovy script
java.lang.SecurityException: Failed to resolve method \[ class java.lang.String join java.lang.String \]
at io.gravitee.policy.groovy.sandbox.SecuredInterceptor.onMethodCall(SecuredInterceptor.java:49)
🌈 Expected behaviour
We should be able to join all the values in a string if we want
The text was updated successfully, but these errors were encountered:
💥 Describe the bug
Since the modification of HTTP Headers in 3.15.x, accessing a header through a groovy script via
request.headers.'My-Header'
will return a string instead of an array of values, meaning it becomes impossible to do array operation (join
for example).🌄 To Reproduce
Steps to reproduce the behaviour:
Add a groovy script to your policy and use:
It should fail with
🌈 Expected behaviour
We should be able to join all the values in a string if we want
The text was updated successfully, but these errors were encountered: