Reputation: 10220
In my Apigee API Proxy, I need to get the environment URL that is defined in my configuration, so that I can send it as part of the response.
For example: http://myorg-test.apigee.net/pricing
However, when I try to get it using proxy.url
, I get an aliased path, like http://rrt18apigee.us-ea.4.apigee.com/pricing
Currently, I'm trying to get it like:
var response = {
proxyUrl : context.getVariable("proxy.url"),
};
Upvotes: 3
Views: 2614
Reputation: 2978
Here is a work around. You can try to get the following variables and create the entire URL
request.Headers.X-Forwarded-Proto
(if you are using cloud version) or client.scheme
if you are using on-premrequest.host
request.path
message.querystring
You can then construct the entire request URL.
( I know this should not be this painful. Please log a bug in case proxy.url is really broken. )
Upvotes: 2