Question
· Sep 20, 2016

onHTTP method not support

Hi All,

         The onHTTPHeader using for redirect body statement.but this not support cache 2016.

     This method return the following text.

�Xmw�:�ܜ��0��-��4�ܒ&��Ro)�����XA�D���=����6༴��������h4#���\�d��iH�Լ'K�Y��P8��juf׾��=<����+6�#�w�9��!�\��'�dK*O����a�a��7��@&\�ǰ�?�=Az(���^�+IU((�2�����n^N��#��SP�i��Q��!d��0a��A �Ѫ��%&��׉�@��o�)���"���Jy��̄��ԝ�#��� \$.[������R�!���K���G�{�c��׺���r�w�P�?�g�w�녫��Y[0һ�����ly~w�[�������?�������ߟ?_N���ym|k��ϟD�Z�pt�����C����M٧�&&�b���0.�����f��d�ŚPx�ԣ )} +�q���^&�'�8�Ȕ0�����(�'����C"���5�n�p���}�] Շo�{=�5�\��ve�*�y�ラ��և�E�����p~qz^�厍�D����rM�_h�fi���o���0n0&�Q�j��E���.T�cy���G���R��}v�W7)Z� z֭!��Q��W҇>1�k�#�������-�W�" ӭ��,� ��G<����r֋����*4PE��:g��L ǍS�Vi�N� ����TΉ@�#9\e��pFd� 9+-ekDrh���Y�vȓ,�*ޥ�vB�S�\o�72���i���9+%�� � X,d�n| U�9X�J �0O�� ��[�aB�k�~ڷ�$�LP��i�߈�@�~��U0c v+�����@�>���1��'���_��]{P7���cP��u�t�*•t��<�3� �� �H��������p-�9"SR&pF��L���2��&��R��q[!�c��r��{��Rp�7 #s�)(z���'�����{Bo��1�R�t� 3�8ݡc9F:啈Ό�q�d��,��Q�A�瞯�܍r��$�f�G�0�������'<�J�4�k�'K]�l2b�2V���y�9N0'�1�L��B��?#;gڀ1K���������������av����]�j���I\惣�<,�"Üd�Ƹ����|�gX)�����7Z�a�r����U�\L|SXPA�Z�t�8�����D�����˺�x�HÊ~���b ֜V���V\��3���SE�ZS��5��*�F%��n�����p�~gh���n����#4k����SO ��M��vZz�3���\����j_vף ౖ ��lCH�H���X�E���i�B�Iu��w' �^1Wy��B<ʦ�*��q��|Ĺ_ׯ��+�_dݱ���>w�����������.a��g�3�U;ЃtŒ�����)�G�Rԥ��]����k\Ҏ�����7jk��

        This method return the <xml >

         

           OnHTTPHeader(ByRef OutputBody As %Library.Boolean) As %Library.Status [ ServerOnly = 1 ]

{

 set sup= $Get(%session.Data("sup")) 

if (sup "")
{
!, "<div style='color:#000000; background:white; ; font-size=10pt;'><B>Your session has expired. Please login <A HREF='AbsLogin.csp' style='color:#668014; background:white; "#008000">serif; font-size=10pt;'>here</A>.<B></div>"
set OutputBody 0
$$$OK
}
else
{
set OutputBody 1

quit 1
}

}

Discussion (4)0
Log in or sign up to continue

I've observed the same issue (garbage output) on a few occasions when there is output (i.e., write statements) before HTTP headers are written. The garbage output might be a CSP Gateway issue, but it is wrong to write prior to headers anyway.

Other than redesigning the class entirely, one thing to try might be outputting headers at the beginning of OnHTTPHeader: 

Set tStatus = %response.WriteHTTPHeader(.OutputBody)

It looks like this doesn't happen automatically if OnHTTPHeader is overridden. Note that %response.WriteHTTPHeader(.OutputBody) will indicate "don't call OnPage" (OutputBody = 0) if there's a redirect or server-side redirect. It's worth considering how your custom OnHTTPHeader behavior should interact with redirects.