Search code examples
wso2apache-synapse

Can I obtain the full URL path of an endpoint inside WSO2 handler/mediator?


I am using WSO2 AM 2.6, with two domains pointing to the GW host:

  1. domain1.com
  2. domain2.com

Is there a way to figure out, inside a mediator or a custom handler, if the API was invoked using domain1.com or domain2.com? Either a property or function that will return the following:

Looking at synapse properties, I see there are properties such as REST_API_CONTEXT and REST_API_ENDPOINT_PATH, but all return /endpoint/1.0.0 and not the complete URL, including the "domainX.com" part.


Solution

  • The hostname should be available in the Host HTTP header.