Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Zope: Users

Strange issues at string operations with request variables

 

 

Zope users RSS feed   Index | Next | Previous | View Threaded


lukesh at seznam

Jan 4, 2012, 1:32 PM

Post #1 of 4 (412 views)
Permalink
Strange issues at string operations with request variables

Hi all,

I have discovered strange issues with all request variables. Here are
examples only, but I was try all useable variables in the REQUEST.

I want to use redirect to another server with same relative link, but
different domain,some like that:

<dtml-call "REQUEST.set('redirect_URL', 'http://www.otherdomain.com' +
URLPATH0)">
<dtml-call expr="RESPONSE.redirect(_.str(redirect_URL), status=301)">

It does not work even if I make obstructions for request variables like
_.str(), _[''] etc.

In cases below variable 'redirect_URL' seems OK, but redirect goes into
loop.

<dtml-call "REQUEST.set('redirect_URL', 'http://www.otherdomain.com' +
PATH_TRANSLATED)">
<dtml-call "REQUEST.set('redirect_URL', 'http://www.otherdomain.com' +
_.str(_['URLPATH1']))">
<dtml-call "REQUEST.set('redirect_URL', 'http://www.otherdomain.com')">

In cases below variable 'redirect_URL' = 'h'.

<dtml-call "REQUEST.set('redirect_URL',
URL.replace(BASE0,'http://www.otherdomain.com')[0])">
<dtml-call "REQUEST.set('redirect_URL',
URL.replace(_.string.split(HTTP_HOST,':')[0],'www.otherdomain.com')[0])">


I was try different (very old) Zope, but result is the same.

It is possible my uncorrect handle with request variables, but how to handle
correct with them?

Many thanks,

J. Lukesh


subhendu.giri at oneworld

Jan 4, 2012, 9:11 PM

Post #2 of 4 (396 views)
Permalink
Strange issues at string operations with request variables [In reply to]

Hi Lukesh,

It is possible through apache |RewriteEngine.

Subhendu
|--

Hi all,
I have discovered strange issues with all request variables. Here are
examples only, but I was try all useable variables in the REQUEST.
I want to use redirect to another server with same relative link, but
different domain,some like that:
<dtml-call "REQUEST.set('redirect_URL', 'http://www.otherdomain.com' +
URLPATH0)">
<dtml-call expr="RESPONSE.redirect(_.str(redirect_URL), status=301)">
It does not work even if I make obstructions for request variables like
_.str(), _[''] etc.
In cases below variable 'redirect_URL' seems OK, but redirect goes into
loop.
<dtml-call "REQUEST.set('redirect_URL', 'http://www.otherdomain.com' +
PATH_TRANSLATED)">
<dtml-call "REQUEST.set('redirect_URL', 'http://www.otherdomain.com' +
_.str(_['URLPATH1']))">
<dtml-call "REQUEST.set('redirect_URL', 'http://www.otherdomain.com')">
In cases below variable 'redirect_URL' = 'h'.
<dtml-call "REQUEST.set('redirect_URL',
URL.replace(BASE0,'http://www.otherdomain.com')[0])">
<dtml-call "REQUEST.set('redirect_URL',
URL.replace(_.string.split(HTTP_HOST,':')[0],'www.otherdomain.com')[0])">
I was try different (very old) Zope, but result is the same.
It is possible my uncorrect handle with request variables, but how to
handle correct with them?
Many thanks,
J. Lukesh


lukesh at seznam

Jan 5, 2012, 8:32 AM

Post #3 of 4 (395 views)
Permalink
Re: Strange issues at string operations with request variables [In reply to]

Hi,

I was try the python script, but no success.

The final cut (as Murphy law says):
<dtml-call
expr="RESPONSE.redirect('http://www.otherdomain.com/path/to/document',
status=301)">

1. At Zope 2.10.13 redirect to samedomain which cause loop, not to the
otherdomain.

2. At Zope 2.7 this redirect is redirected to otherdomain which is expected.
At Zope 2.7 I was not test redirect with PySript.

So I use redirect to home page.


----- Puvodní zpráva -----
Od: William Heymann


What I would do is do this with a python script instead of DTML. You will
find this kind of stuff is much simpler with a python script you just call
from DTML


something like


REQUEST['redirect_URL'] = 'http://www.otherdomain.com' + REQUEST.URLPATH0



2012/1/4 Jaroslav Lukesh <lukesh [at] seznam>

Hi all,

I have discovered strange issues with all request variables. Here are
examples only, but I was try all useable variables in the REQUEST.

I want to use redirect to another server with same relative link, but
different domain,some like that:

<dtml-call "REQUEST.set('redirect_URL', 'http://www.otherdomain.com' +
URLPATH0)">
<dtml-call expr="RESPONSE.redirect(_.str(redirect_URL), status=301)">

It does not work even if I make obstructions for request variables like
_.str(), _[''] etc.

In cases below variable 'redirect_URL' seems OK, but redirect goes into
loop.

<dtml-call "REQUEST.set('redirect_URL', 'http://www.otherdomain.com' +
PATH_TRANSLATED)">
<dtml-call "REQUEST.set('redirect_URL', 'http://www.otherdomain.com' +
_.str(_['URLPATH1']))">
<dtml-call "REQUEST.set('redirect_URL', 'http://www.otherdomain.com')">

In cases below variable 'redirect_URL' = 'h'.

<dtml-call "REQUEST.set('redirect_URL',
URL.replace(BASE0,'http://www.otherdomain.com')[0])">
<dtml-call "REQUEST.set('redirect_URL',
URL.replace(_.string.split(HTTP_HOST,':')[0],'www.otherdomain.com')[0])">


I was try different (very old) Zope, but result is the same.

It is possible my uncorrect handle with request variables, but how to handle
correct with them?

Many thanks,

J. Lukesh

_______________________________________________
Zope maillist - Zope [at] zope
https://mail.zope.org/mailman/listinfo/zope
** No cross posts or HTML encoding! **
(Related lists -
https://mail.zope.org/mailman/listinfo/zope-announce
https://mail.zope.org/mailman/listinfo/zope-dev )


lukesh at seznam

Jan 5, 2012, 11:08 AM

Post #4 of 4 (390 views)
Permalink
Re: Strange issues at string operations with request variables [In reply to]

Hi, it make loop, not redirect to the new domain.

----- Puvodní zpráva -----
Od: "Giampiero Benvenuti" <giampiero.benvenuti [at] chiaroscuro>


what about
<dtml-call "RESPONSE.redirect(new_url, lock=1)">

_______________________________________________
Zope maillist - Zope [at] zope
https://mail.zope.org/mailman/listinfo/zope
** No cross posts or HTML encoding! **
(Related lists -
https://mail.zope.org/mailman/listinfo/zope-announce
https://mail.zope.org/mailman/listinfo/zope-dev )

Zope users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.