Synthetic Classic has reached end of support and is no longer available. Existing Synthetic Classic customers have been upgraded to the all-in-one Dynatrace software intelligence platform.

Map the HOST origin

In addition to setting the Host Mapping section of a script, Akamai scripts frequently need an event hook to properly set the Host Origin for each request being made. The code below is the event hook that is needed.

In the example, replace the outlet.lenovo.com entries with whatever host you are trying to map.

var findHTTP = new AddEventHookCommand({
"eventType": "sendingRequest",
"name": "getHTTP",
"handler":"if(request.url.indexOf('outlet.lenovo.com') != -1){alert(request.url);request.replaceHeader('Host', 'outlet.lenovo.com');}"
});

findHTTP.execute();