1.9

Setting Custom Headers
 It works great to the extent that it creates and sends the http request with your custom headers. It fails however to set the document.referrer (as an example) value as accessible by Javascript on the website.
Below is my testcase, it just does not work when I set referer using phantomjs.
Obvious we need a fix about this.

1. phantomjs code.
page.customHeaders = {
        'Referer' : 'http://sogou.com',
};


2. Test html file, which checks the referer.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <script type="text/javascript" src="http://ip.ws.126.net/ipquery"></script>

    <script type="text/javascript">
        //alert([lo, lc].join('\t'));
                        var strRef = document.referrer;
                        if(strRef.toLowerCase().indexOf("s") >= 0) {
                                window.location.href = 'http://sogou.com';
                        }
                        else
                                window.location.href = 'http://baidu.com';
    </script>
</head>
</html>