[Mojolicious] csrf vs testing

2020-11-03 Thread dal...@gmail.com
This might be an obvious question, but I haven't found a good answer

I'm rewriting our old webapplications into Mojolicious. Goes just fine.

Might as well add csrf protection (exactly when is csrf tokens recommended?)

But then how do we test with csrf protection (via $v = $v->csrf_protect; 
from Mojolicious::Validator::Validation) enabled?

So if for example I'm testing my editing mode and is using (data is 'good' 
data that validates if there is no csrf protection)

$t -> post_ok( $url, form => $data )

What exactly are we suppose to add to our tests such that we can test with 
csrf_protect?

/daleif

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/2ce6ba78-48d4-4ed5-baf2-baf80fae5282n%40googlegroups.com.


[Mojolicious] find comments (Mojo::Dom)

2020-12-09 Thread dal...@gmail.com

I'm not sure if this is obvious or not.

I have some *very* old webpages what I need to have archived. But that site 
used Apache Server Side Includes (yes that old)

So I wanted to see if there are any of these magic comments left. Yes, I 
can easily do this with a normal find and grep in the commandline, but 
since I like working with Mojo::DOM I'd like to see if I could do it with 
this as well.

Is there any way of getting the comments other can looking at the type of 
all the tags?

I didn't see anything obvious via $dom -> find

Ideas?

/daleif

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/9e7f27d2-aa41-4096-b5d3-62a927c921c5n%40googlegroups.com.