You are viewing a plain text version of this content. The canonical link for it is here.
Posted to rivet-dev@tcl.apache.org by Witek Mozga <mo...@trimen.pl> on 2014/08/15 21:59:41 UTC

POST problem

Hello,

I`ve been using rivet for some time and noticed that the latest version
seems to misinterpret variables sent via POST. Namely, their content is
repeated: 

'data data' instead of 'data'

 despite that the raw_post command shows the correct contents.

---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-dev-unsubscribe@tcl.apache.org
For additional commands, e-mail: rivet-dev-help@tcl.apache.org


Re: POST problem

Posted by Massimo Manghi <ma...@unipr.it>.
The way rivet's concocted the output of command 'info script' has been 
replaced by command [::rivet::inspect script].

The former way required a Tcl script to be evaluated at every request, 
even when the information was unneeded or irrelevant. Since the feature 
was undocumented and in order to save an extra call to Tcl we removed 
that call and changed the way the information could be fetched.

Perhaps your case witnesses the need to provide a compatible way to 
return the same information hooking a command that to replace the Tcl 
interpreter's native command.

Keep in mind the same information can be obtained also from the 
environment (::rivet::load_env environment). Printing the whole 
environment array will show you which variables in array have this info 
and in which form

  -- Massimo




---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-dev-unsubscribe@tcl.apache.org
For additional commands, e-mail: rivet-dev-help@tcl.apache.org


Re: POST problem

Posted by Witek Mozga <mo...@trimen.pl>.
The problem seems to be a tricky one and I was not able to prepare a
simple example to show it (which is strange) but I think I finally found
where it comes from.

 I have rather complex website with many HTML forms so I don`t want to
 put my complicated code here but I made comparison which versions of
 Rivet work and which do not:

Ubuntu 14.04 i686:
rivet 2.1.3 (from repo - working OK)
tcl 8.6.1
apache 2.4.7

Slackware 14 i686:
rivet 2.0.6 (compiled - working OK)
rivet 2.1.0 (compiled - working OK)
rivet 2.1.4 (compiled - problem)
rivet 2.2.0 (compiled - problem)
tcl 8.5.11
apache 2.4.10

Arch Linux i686:
rivet 2.1.0 (compiled - working OK)
rivet 2.1.4 (compiled - problem)
rivet 2.2.0 (compiled - problem)
tcl 8.6.1
apache 2.4.10

Debian testing amd64
rivet 2.2.0 (from repo - problem)
tcl 8.6.1
apache 2.4.10

*** It looks that the last working version is 2.1.3. ***

I thought the error is in my code or maybe apache changed something but
I finally I found that I`m using below code in many places:

<FORM name='update_form'  ACTION='$::script' METHOD='POST' >

where $::script is defined as

set ::script [file tail [info script]]

Which should just give me the filename of the currently running
script (in order to not change action parameter every time the
filename changes. )

I finally found that the latest Rivet doesn`t return the filename
via  [info script]. This gives the empty string for action='' which in
turn SOMETIMES works and SOMETIMES not (in combination with POST but GET
seems to work properly every time).

So [info script] is the source of my problems.

Please advise if this is a bug or maybe [info script] is deprecated?

> Please, would you tell us more about your problem? Are you using 
> ::rivet::var or ::rivet::load_response? Can you show an example of a 
> form that produces this undesired outcome?
> 
>   -- Massimo
> 
> On 08/15/2014 09:59 PM, Witek Mozga wrote:
> > Hello,
> >
> > I`ve been using rivet for some time and noticed that the latest
> > version seems to misinterpret variables sent via POST. Namely,
> > their content is repeated:
> >
> > 'data data' instead of 'data'
> >
> >   despite that the raw_post command shows the correct contents.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: rivet-dev-unsubscribe@tcl.apache.org
> > For additional commands, e-mail: rivet-dev-help@tcl.apache.org
> >


---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-dev-unsubscribe@tcl.apache.org
For additional commands, e-mail: rivet-dev-help@tcl.apache.org


Re: POST problem

Posted by Massimo Manghi <ma...@unipr.it>.
Please, would you tell us more about your problem? Are you using 
::rivet::var or ::rivet::load_response? Can you show an example of a 
form that produces this undesired outcome?

  -- Massimo

On 08/15/2014 09:59 PM, Witek Mozga wrote:
> Hello,
>
> I`ve been using rivet for some time and noticed that the latest version
> seems to misinterpret variables sent via POST. Namely, their content is
> repeated:
>
> 'data data' instead of 'data'
>
>   despite that the raw_post command shows the correct contents.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: rivet-dev-unsubscribe@tcl.apache.org
> For additional commands, e-mail: rivet-dev-help@tcl.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-dev-unsubscribe@tcl.apache.org
For additional commands, e-mail: rivet-dev-help@tcl.apache.org