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 entries with whatever host you are trying to map.

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