Skip to Content
0
Nov 09, 2018 at 07:46 AM

Custom header not forwarded with AJAX request on destination

383 Views

Seems that custom headers are stripped out from the request when an $.AJAX call is executed on a destination endpoint. Is this by design? It's limiting connectivity options since there is even no way to specify custom static headers on the definition of the destination in SAP Cloud Platform connectivity.


Steps to reproduce:

1. Setup a URL to catch your requests from SAP Cloud Platform (e.g. via http://postb.in)

2. Create a destination with this URL

3. Create a simple UI5 app and in the onInit() do an AJAX call to the destination

$.ajax({
    type: "GET",
    contentType: "application/json",
    url: "myPostBin/testing",
    dataType: "json",
    headers: {
        "customHeader": "doyouseeme?"
    },
    success: function (data, textStatus, jqXHR) {
        alert(data);
    }
});