Nevow URL flattening (was Re: [Twisted-web] livepage)

Matt Goodall matt at
Mon May 2 05:24:57 MDT 2005

Matt Goodall wrote:

>Tommi Virtanen wrote:
>>Christopher Zorn wrote:
>>>>As I was the first to make this mistake, I'll answer : if you use Nevow
>>>>behing a
>>>>proxy (really, it's a proxy ? what did you mean by firewall ?), you
>>>>should look
>>>>after nevow.vhost.VHostMonsterResource.
>>>Sorry, a reverse proxy. I have an apache reverse proxy to get to the
>>>running the nevow livepage application. How will
>>>fix this?
>>>The problem is, when I call render_liveglue it gives a tag similar to
>>><script src=http://server.behind.the.firewall.tld/nevow_glue.js />
>>>It needs to be the correct server or just nevow_glue.js in order to
>>>work correctly.
>>Just wanted to confirm this quickly: you must use VHostMonsterResource,
>>and the code change you suggested is not needed. Without
>>VHostMonsterResource, many other things will fail too; first you are
>>likely to notice are redirects.
>>To all nevow developers:
>>On the other hand, if you want to link to a resource in the current
>>directory, is really unnecessary -- please try to use relative
>>URLs when they work. 
>I don't think is a good recommendation until rend.Page stops always
>handling an additional empty segment regardless of the value of
>addSlash. This behaviour has already been deprecated but not yet
>removed. See nevow.rend.Page.child_.
>Right now, there's no way the developer can know if the URL the user
>used to reach the page is /foo or /foo/ and that makes it difficult to
>construct a correct relative URL.
>I guess it's time to remove the deprecated child_ stuff.
Of course, we could just improve the URL flattener to write out relative
URLs whenever possible. That should make it a lot easier to deploy Nevow
apps behind proxies.

The only issue with doing that is that the URL instance's attributes all
need flattening before we can compare them to the current URL, and last
time I tried doing something like that I got into all sorts of
strangeness ;-).

Can anyone see a reason for *not* doing this? I might take a crack at
this sometime soon.

- Matt

    /  \__     Matt Goodall, Pollenation Internet Ltd
    \__/  \    w:
  __/  \__/    e: matt at
 /  \__/  \    t: +44 (0)113 2252500
 \__/  \__/
 /  \	       Any views expressed are my own and do not necessarily
 \__/          reflect the views of my employer.

More information about the Twisted-web mailing list