PYQT4 referer in javascript still blank

Peter Irbizon peterirbizon at gmail.com
Sat Nov 1 14:07:01 CET 2014


Hello,
I am trying to set referrer for my script this way in PYQT4:

class NetworkManager(QNetworkAccessManager):
    def createRequest(self, op, req, outgoing_data):
        req.setRawHeader('Referer', 'http://www.my-university.com/')
        req.setRawHeader('Accept-Language', 'en')
        return super(NetworkManager, self).createRequest(op, req,
outgoing_data)

but when I use javascript document.write('js ref: ' + document.referrer
+'<br>'); on my website it still returns empty line.
When I use php $_SERVER["HTTP_REFERER"] it returns correct referer.

How should I make it working for javascript as well?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20141101/61a67279/attachment.html>


More information about the Python-list mailing list