This is a snapshot of Indico's old Trac site. Any information contained herein is most probably outdated. Access our new GitHub site here.

Ticket #249: htdocs-http_referer.patch

File htdocs-http_referer.patch, 1.0 KB (added by vokac, 6 years ago)
  • changeLang.py

    diff -NPur htdocs.orig/changeLang.py htdocs/changeLang.py
    old new  
    11import MaKaC.webinterface.rh.lang as lang 
     2from MaKaC.common import Config 
    23def index(req, **args): 
    3     args['REFERER_URL'] = (str(req.headers_in['Referer'])) 
     4    args['REFERER_URL'] = (str(req.headers_in.get('Referer', Config.getInstance().getBaseURL()))) 
    45    return lang.RHChangeLang(req).process(args) 
    56 
  • resetSessionTZ.py

    diff -NPur htdocs.orig/resetSessionTZ.py htdocs/resetSessionTZ.py
    old new  
    11import MaKaC.webinterface.rh.resetTimezone as resetTimezone 
     2from MaKaC.common import Config 
    23def index(req, **args): 
    3     args['REFERER_URL'] = (str(req.headers_in['Referer'])) 
     4    args['REFERER_URL'] = (str(req.headers_in.get('Referer', Config.getInstance().getBaseURL()))) 
    45    return resetTimezone.RHResetTZ(req).process(args) 
    56