openwhisk-apigateway
openwhisk-apigateway copied to clipboard
Adding Transform All policy for queries incorrectly removes query parameters in the backendUrl
According to the policy docs, to transform all query parameters to body, you would put this in policies:
{
"action": "transform",
"from": {
"name": "*",
"location": "query"
},
"to": {
"name": "*",
"location": "body"
}
}
However, this also removes the query parameters in the backendUrl.
The backend query parameters are added to the query array at the beginning https://github.com/openwhisk/apigateway/blob/develop/api-gateway-config/scripts/lua/policies/mapping.lua#L63. The other query parameters were being added into the query array in addition to the backend query parameters. If ngx.var.backendUrl
is still being set, I'll need to double check the order of the override.
Is this now working as expected?