Layer7 API Management

Expand all | Collapse all

Why gateway is stripping the data after "#" in URL

Jump to Best Answer
  • 1.  Why gateway is stripping the data after "#" in URL

    Posted 04-07-2017 12:38 PM

    We observed below in one of the case where the URL Query Parameter has a "#" in it. Gateway is trimming the data after the "#" while receiving as shown in below example.

    Invoked URL:

          https://gatewaydomain/example/v1/customers?type=new&email=example#hashword@example.com&include=alldata 
    Received URL in Gateway :

          https://gatewaydomain/example/v1/customers?type=new&email=example   

     

    How this can be avoided? One option is to encode the url while invoking. But is there any other option as the consuming application does not want to encode the data.



  • 2.  Re: Why gateway is stripping the data after "#" in URL

    Posted 04-07-2017 12:54 PM

    The hash fragment of the URL is not supposed to be sent to the server (ie: the Gateway). It is to be sent to and processed by the browser. 

     

    If you need to retrieve anything after the hash fragment I would suggested using some JavaScript in a return template response. However this not allow you to variablize the data and use it in policy.

     

    Regards,

    Joe



  • 3.  Re: Why gateway is stripping the data after "#" in URL
    Best Answer

    Posted 04-07-2017 12:56 PM

    Mohindra.Singh actually posted a sample policy below allowing you to retrieve and convert this to a query parameter that can be used by the Gateway:

     

    Sample Policy for converting a URL hash fragment into a query parameter