I have a CloudPage returning an error this week, which has never errored in the past.
After closer examination, I've determine the page is failing on this line of code %%=HTTPRequestHeader('Authorization')=%%
.
I was able to wrap the code in an SSJS try catch to get the Marketing Cloud error message. The code executes fine if any string other than 'Authorization' is used in the call.
It seems as though something has changed on the Marketing Cloud platform. But, I'm unable to confirm this. Any suggestion or advice would be greatly appreciated!
test code:
<script runat="server">
Platform.Load("Core","1.");
try {
</script>
<pre>
Content-Type = %%=HTTPRequestHeader('Content-Type')=%%
Authorization = %%=HTTPRequestHeader('Authorization')=%%
</pre>
<script runat="server">
} catch(e) {
Write(Stringify(e));
}
</script>
output:
{"message":"An error occurred when attempting to evaluate a HTTPRequestHeader function call. See inner exception for details.","description":"ExactTarget.OMM.FunctionExecutionException: An error occurred when attempting to evaluate a HTTPRequestHeader function call. See inner exception for details.\r\n Error Code: OMM_FUNC_EXEC_ERROR\r\n - from Jint --> \r\n\r\n --- inner exception 1---\r\n\r\nExactTarget.OMM.FunctionExecutionException: An unauthorized HTTPRequestHeader has been requested.\r\n Function: HTTPRequestHeader('Authorization')\r\n LandingPageID: 0\r\n URL: http://pub.s7.exacttarget.com:9002/REDACTED\r\n Context: LandingPage\r\n StackID: 7\r\n EnterpriseID: 12345678\r\n ClientID: 7203368\r\n Client Database ID: 718\r\n Account Type: PRO_CONNECT_CLIENT\r\n JobID: 0\r\n SubscriberID: 0\r\n Content Type: HTML\r\n MachineName: ATL1S07PGS187\r\n Error Code: OMM_UNAUTH_HTTP_REQ_HDR_ERR\r\n - from OMMCommon\r\n\r\n\r\n\r\n"}