List Info

Thread: Re: Can't find my canary




Re: Can't find my canary
country flaguser name
United States
2007-09-24 11:35:47
Dennis:
>;> Did your fix not get to git yet?

Jonathan:
> It's there now. On my machines, Session::State::Cookie still isn't
> working, so tests fail for me. But if they pass for you,
> you should be good to go.

I bypassed s-s-cookie, manually installed c-p-FormCanary, but
the magic isn't working for me yet.

I have a question based on this code snippet:
 #=====================================
 if ($content_type =~ /html/){
   some stuff here...
   # add the input tags to the body
 ;  my $body = $c->response->body;
   $body =~       ;  # yuck.
&nbsp; &nbsp;  s{</form>}
&nbsp; &nbsp; &nbsp; {<input type="hidden" name="$name" id="$name" value="$canary" />
&nbsp; &nbsp; &nbsp;  </form&gt;}g;
&nbsp;  $c->log->debug("$body"); # << I added debug msg
   $c->response->body($body);
 }
&nbsp;return $c->NEXT::finalize_session(_);
 #=====================================

Here's what I do not understand:

The "canary" hidden input tag IS ADDED, according to $c->log->debug("$body")

But the "canary" hidden input tag DOES NOT show up in the page
sent to the browser? Why would that be?

I'm using TT for view; I have an empty
sub end : ActionClass('RenderView') { }
c-p-renderview just returns 1 if length $c->response->body,
so probably something's working in a way I don't get yet,
or works in a way different from what I *think* is happening.

I copied some of FormCanary's code into a webcard widget,
twiddled a bit, and it works great. I haven't written any
action classes, but it would be really nice to use this as
an action class (which I see is on the todo list). I'll
mess around some more with this, see what else I can learn.

/dennis
Re: Can't find my canary
country flaguser name
United Kingdom
2007-09-24 15:29:14
On Mon, Sep 24, 2007 at 09:35:47AM -0700, Dennis Daupert
wrote:
> Dennis:
> >> Did your fix not get to git yet?
> 
> Jonathan:
> > It's there now. On my machines,
Session::State::Cookie still isn't
> > working, so tests fail for me. But if they pass
for you, 
> > you should be good to go. 
> 
> I bypassed s-s-cookie, manually installed
c-p-FormCanary, but
> the magic isn't working for me yet.
> 
> I have a question based on this code snippet:
>  #=====================================
>  if ($content_type =~ /html/){
>    some stuff here...
>    # add the input tags to the body
>    my $body = $c->response->body;
>    $body =~         # yuck.
>      s{</form>}
>       {<input type="hidden"
name="$name" id="$name"
value="$canary" />
>        </form>}g;
>    $c->log->debug("$body"); # <<
I added debug msg
>    $c->response->body($body);
>  }
>  return $c->NEXT::finalize_session(_);
>  #=====================================
> 
> Here's what I do not understand:
> 
> The "canary" hidden input tag IS ADDED,
according to $c->log->debug("$body")

It's being added after the body's sent to the browser.

-- 
      Matt S Trout       Need help with your Catalyst or
DBIx::Class project?
   Technical Director                    http://www.shado
wcat.co.uk/catalyst/
 Shadowcat Systems Ltd.  Want a managed development or
deployment platform?
http://chainsawblues.vo
x.com/            http://www.shadow
cat.co.uk/servers/

_______________________________________________
List: Catalystlists.rawmode.org
Listinfo: ht
tp://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-
archive.com/catalystlists.rawmode.org/
Dev site: http://dev.catalyst.per
l.org/

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )