I'll try not to be confusing but I am literally perplexed over this situation.
I am using getallheaders()
for one of my application to get all the header information. It is being used in a following way :-
<?php
header('Content-Type: application/json');
echo json_encode(getallheaders());
?>
The problem now is that it provides different output for my dev and production server, which is why my application doesn't work on Production yet it works on Dev. I am trying my best to find the reason for it but still to no avail.
\::<html><head></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">
{"accept":"text\/html,application\/xhtml+xml,application\/xml;q=0.9,*\/*;q=0.8",
"accept-language":"en-us",
"connection":"close",
"content-length":"0",
"host":"production-host",
"iv-user":"cn=First_Name%20Last_Name,
ou=NYC,
ou=NorthAmerica,
o=Company_Name",
"user-agent":"Mozilla\/5.0 (iPad; CPU OS 6_1 like Mac OS X) AppleWebKit\/536.26 (KHTML, like Gecko) Mobile\/10B141",
"via":"HTTP\/1.1 .company_name.com:80",
"**location_office_code" :"XYZ"**,
"iv_server_name":"default-webseald-na-pcompanyname.intranet.company_name.com",
"vendorid":"a_number",
"person_id":"a_number",
**"position_category":"NOT_FOUND","position_code":"NOT_FOUND",
"region_code":"North%20America",
"mail":"Email-Address"**,
"x-forwarded-for":"IP_Address",
"Cookie":"s_nr=1324338612-New"}</pre></body></html>
[INFO] : strJsonContent information:
{"accept":"text\/html,application\/xhtml+xml,
application\/xml;q=0.9,*\/*;q=0.8",
"accept-language":"en-us",
"connection":"close",
"content-length":"0",
"host":"host_name",
"iv-user":"cn=FIRST_NAME%20LAST_NAME,
ou=NYC,
ou=NorthAmerica,
o=COMPANY_NAME",
"user-agent":"Mozilla\/5.0 (iPad; CPU OS 6_1 like Mac OS X) AppleWebKit\/536.26 (KHTML, like Gecko) Mobile\/10B141",
"via":"HTTP\/1.1 .comapny_name:80",
"location_office_code":"XYZ",
"iv_server_name":"default-webseald-na-comapny_name.com",
"vendorid":"a-number",
"person_id":"a-number",
"position_category":"NOT_FOUND",
"position_code":"NOT_FOUND",
"region_code":"North%20America",
"mail":"EMAIL_ADDRESS",
"x-forwarded-for":"IP_ADDRESS",
"Cookie":"s_nr=1324338612-New"
}
\::<html><head></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">
{"accept":"text\/html,application\/xhtml+xml,application\/xml;q=0.9,
*\/*;q=0.8",
"accept-language":"en-us",
"connection":"close",
"content-length":"0",
"host":"production-host",
"iv-user":"cn=First_Name%20Last_Name,
ou=NYC,
ou=NorthAmerica,
o=Company_Name",
"user-agent":"Mozilla\/5.0 (iPad; CPU OS 6_1 like Mac OS X) AppleWebKit\/536.26 (KHTML, like Gecko) Mobile\/10B141",
"via":"HTTP\/1.1 .company_name.com:80",
"iv_server_name":"default-webseald-na-pcompanyname.intranet.company_name.com",
"vendorid":"a_number",
"person_id":"a_number",
"x-forwarded-for":"IP_Address",
"Cookie":"s_nr=1324338612-New"}
</pre></body></html>
[INFO] : strJsonContent information:
{"accept":"text\/html,application\/xhtml+xml,
application\/xml;q=0.9,
*\/*;q=0.8",
"accept-language":"en-us",
"connection":"close",
"content-length":"0",
"host":"host_name","iv-user":"cn=First_Name%20Last_Name,ou=NYC,ou=NorthAmerica,o=Company_Name",
"user-agent":"Mozilla\/5.0 (iPad; CPU OS 6_1 like Mac OS X) AppleWebKit\/536.26 (KHTML, like Gecko) Mobile\/10B141",
"via":"HTTP\/1.1 .company_name.com:80",
"iv_server_name":"default-webseald-na-pcompany_name.intranet.company_name.com",
"vendorid":"a_number",
"person_id":"a_number",
"x-forwarded-for":"IP_Address",
"Cookie":"s_nr=1324338612-New"}
[INFO] : responseAsJSON info:[object Object]
The things which are missing in the Production JSON are - position_category - position_code - region_code - mail
The most important being is mail
. Any idea why it's missing in the production? Where can I confirm that which values are being added in the Header and why can any value miss in this instance?
Thanks a lot.