collective/collective.z3cform.wizard — pull request #4 by avolkov (2012-12-18 16:23:57+00:00)
Title: Fix for production configuration

I found an issue with z3cform.wizard, when I use it in a 'production' configuration with url rewriting such as this (snippet from buildout.cfg, nginx section):

location / {
rewrite ^/(.*) /VirtualHostBase/http/$http_host:80/samplesite/VirtualHostRoot/$1 break;
proxy_pass http://zope;
proxy_set_header Host $host;
}

When trying to submit a form where I have a multi-step form, instead of saving data and proceeding to the next step, a check in wizard.py that compares referer and actual url fails because form action uses internal url i.e. http://hostname/samplesite instead of external url http://samplesite.com

Replacing calls from request.getURL to self.absolute_url (where self is the instance of form wizard) fixes the problem.

Thanks,

Alex.