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();