Layer7 API Management

  • 1.  Mysterious empty response message

    Broadcom Employee
    Posted Sep 08, 2015 08:40 AM

    Dear CA API Management Community,

     

    I currently facing some troubling issue, maybe someone here could help me.

    I am working under 8.3 API Gateway version. The use case is pretty simple: I am developing a proxy API.

    The policy template is quite usual: authorize/authenticate -> some security checks, building the request and routing to the backend service.

     

    Response returned from the Gateway is then OK and because I left default routing option and its ${response} variable, moreover it was useless to use the “Response template” assertion.

     

    Then I wanted to make some work on this response message. And here is the issue: for the Gateway: it is empty !

     

    ${response.mainpart} is empty

    ${response.mainpart.size} = ${response.size} = more than 1000 bytes (so it is not an multipart response)

    Yet there is something, since I have the expected response that is returned!

     

    Then I set the audit.originalMainPart.enable cluster property to "true" in order to check the response without any Gateway modification. I found that the backend service left empty the Content-Type header…

     

    After Gateway processing, the response.contentType was set to “application/x-suggestions+json”.

    Is it a Gateway bug case ? I reproduced it with another backend service, once again the original response Content type was empty, but this time the gateway processed response CT was « application/octet-stream »

    Any idea to help me ? Did everyone already faced this problem ?

     

    PS : between my Gateway and internet I have a proxy, but from my point of view the issue is not related to it ….



  • 2.  Re: Mysterious empty response message

    Posted Sep 09, 2015 08:55 AM

    Some back ends doesn't return response if valid Content-type is not set in the request. Have you tried setting "Content-Type" header in the request based on data you are sending?

     

    Regards,

    Ganesh



  • 3.  Re: Mysterious empty response message
    Best Answer

    Broadcom Employee
    Posted Sep 09, 2015 09:03 AM

    Dear Styganesh,

     

    Thank you for replying to my post, I solved my problem a few minutes before your message

     

    As first described  the requested backend service left empty the Content-Type in its responses.

    Consequently I set the io.httpDefaultContentType cluster property to "application/json;charset="UTF-8" (needed for this case) and ... ${response.mainpart} becomes set and exploitable.


    Thank you again.


    Regards.