[PyQt] referer in javascript still blank

Peter Irbizon peterirbizon at gmail.com
Sat Nov 1 11:34:08 GMT 2014


Hello,
I am trying to set Referrer for my script this way:

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://www.riverbankcomputing.com/pipermail/pyqt/attachments/20141101/4975a700/attachment.html>


More information about the PyQt mailing list