On 10/24/07, Frank Burkhardt <[EMAIL PROTECTED]> wrote:

>
> The web server never gets the URL which as typed by the user. At least
> the protocol (http vs. https),  is lost. This is what you can do:
>
>  url='http://' + request['HTTP_HOST'] + request['REQUEST_URI']
>

Does this work for Zope3? I use zopeproject, and starting the server with

bin/paster serve debug.ini

It doesn't seem that the request has a key 'REQUEST_URI':

(Pdb) request
<zc.resourcelibrary.publication.Request instance
URL=http://rhodium.homemaster.cn/products/101>
(Pdb) request.keys()
['HTTP_MAX_FORWARDS', 'HTTP_ACCEPT_LANGUAGE', 'SCRIPT_NAME',
'REQUEST_METHOD', 'PATH_INFO', 'SERVER_PROTOCOL', 'QUERY_STRING',
'paste.throw_errors', 'HTTP_X_FORWARDED_SERVER', 'CONTENT_LENGTH',
'HTTP_ACCEPT_CHARSET', 'HTTP_USER_AGENT', 'HTTP_CONNECTION',
'SERVER_NAME', 'REMOTE_ADDR', 'wsgi.url_scheme', 'SERVER_PORT',
'paste.evalexception', 'wsgi.input', 'HTTP_HOST', 'wsgi.handleErrors',
'wsgi.multithread', 'HTTP_ACCEPT', 'wsgi.version', 'wsgi.run_once',
'wsgi.errors', 'wsgi.multiprocess', 'HTTP_X_FORWARDED_HOST', u'page',
'HTTP_X_FORWARDED_FOR', 'CONTENT_TYPE',
'paste.httpserver.thread_pool', 'HTTP_ACCEPT_ENCODING']
(Pdb) request['REQUEST_URI']
*** KeyError: 'REQUEST_URI'


-- 
Hong Yuan

大管家网上建材超市
装修装潢建材一站式购物
http://www.homemaster.cn
_______________________________________________
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users

Reply via email to