The web in a box - a next generation web framework for the Perl programming language

IRC log for #mojo, 2015-09-30

| Channels | #mojo index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:01 asm35 joined #mojo
00:13 jantore joined #mojo
00:13 asm35 joined #mojo
00:21 mattastrophe joined #mojo
00:29 sri oh, the 5x cases look great https://store.google.com/product/adopted_folio_n5x
00:29 mattastrophe joined #mojo
00:35 Zoffix :S the pattern is a bit heavy
00:37 damaya joined #mojo
00:40 jberger I'm getting close to end of contact, I need to find me another free phone
00:40 jberger Yay for generation old tech
01:10 disputin joined #mojo
01:16 aborazmeh joined #mojo
01:22 asarch joined #mojo
01:31 damaya joined #mojo
01:50 damaya joined #mojo
02:00 damaya joined #mojo
02:10 sri hmm, i guess there is a way to avoid the auto retry race condition
02:11 sri the number of current retries would have to be passed around, so a state transition can only happen if the number of retries still matches
02:11 sri it's a rather big api change though
02:13 sri in the backend api
02:22 sri basically ->finish_job and ->fail_job need to reference a certain point in time
02:23 sri so it will have to be ->finish_job($job_id, $retries, $result))
02:26 damaya joined #mojo
02:37 noganex_ joined #mojo
02:38 gorfel joined #mojo
02:44 sri yea, this is going to happen, gonna bump minion to 2.0 ;p
02:44 sri nic: if you want substantial changes, now is the time
02:55 kaare joined #mojo
03:01 sri yay, and i have a test case for the race condition
03:04 davido_ joined #mojo
03:09 sri https://github.com/kraih/minion/commit/c20e3dc5e8756157b8d5087f78dfe98fde7f0062
03:09 sri \o/
03:09 sri that means you can now safely call $job->finish; $job->retry; from within your task
03:10 sri or even fail it yourself
03:11 bpmedley_ Good job, cool stuff
03:14 disputin joined #mojo
03:19 kaare joined #mojo
03:27 disputin joined #mojo
03:30 gorfel Is it possible to use DBIx::Connector with DBIx::Simple? I am having problems with preforking and DBIx::Simple connection.
03:30 kanishka joined #mojo
03:42 inokenty-w joined #mojo
03:45 zivester joined #mojo
03:51 lluad joined #mojo
04:06 davido__ joined #mojo
04:12 asm35 joined #mojo
04:12 gorfel Well, I think I will use DBIx::Custom instead.
04:25 damaya joined #mojo
04:28 sri hmm, i guess retry_job should just use a retries argument as well
04:28 sri just to make everything work the same
04:28 sri and possibly prevent a more harmless race condition
04:29 sri retries is basically different versions of a job
04:29 sri if you have a $job object, and you call ->rety on it, it makes sense that you would only want to retry the current version of it
04:35 damaya joined #mojo
05:03 firnsy sri++
05:13 nic_ joined #mojo
05:14 nic_ yay for 2.0
05:16 nic_ sri: my change is tiny; I'll definitely have a pr to you today
05:17 sri nic_: it's more about good use cases
05:18 nic_ (got an 'enterprise'  meeting with a delegation flying in from France; otherwise I would say this morning)
05:19 nic_ oh ok, so I just need to confirm small change opens up useful opportunities
05:20 * nic_ &
05:21 sri the one you mentioned earlier, backends adding their own options doesn't really count
05:21 sri the whole point of the backend api is to have everything consistent
05:23 sri already over a year :( https://github.com/makamaka/JSON-PP/pull/10
05:35 preaction someone really needs to take that dist over...
05:36 cpan_mojo Mercury-0.003 by PREACTION https://metacpan.org/release/PREACTION/Mercury-0.003
05:51 berov joined #mojo
05:55 damaya joined #mojo
05:58 chansen sri: ok, how do you decode/encode an URL encoded string (application/x-www-form-urlencoded) using Mojo?
06:16 trone joined #mojo
06:17 aborazmeh joined #mojo
06:49 stephen joined #mojo
07:06 asm35 left #mojo
07:07 * sri has been wondering again if a hash with arbitrary metadata would make sense for minion jobs
07:08 sri for extensions
07:08 sri $minion->enqueue(foo => {meta => {auto_retry => 1}})
07:10 sri $minion->on(worker => sub { pop->on(dequeue => sub { pop->on(failed => sub { $_[1]->retry({delay => 60}) if $_[1]->meta->{auto_retry} }) }) })
07:12 sri guess that could be done at any time, doesn't require a major release
07:17 eseyman joined #mojo
07:18 sri stumbled over another funny job queue feature too, ttl jobs
07:18 sri if they don't run before the deadline, they just vanish
07:19 sri (seems rather useless to me, but people put that in commercial versions of job queues)
07:22 trone joined #mojo
07:22 stephan48 sri: i think this feature is somewhat similar to "unique" keys to prevent f.e. a reindex for a search index to be queued twice
07:23 stephan48 if such a job is trigged once per day and the job is not performed by the time the next job runs it is useless to keep the "older" job around
07:26 sri of course you could just check the time inside the task
07:27 sri return if $job->info->{started} > ($job->info->{created} + 300);
07:30 damaya joined #mojo
07:31 stephan48 sri: that is true
07:38 berov left #mojo
07:39 berov joined #mojo
07:42 berov left #mojo
07:42 berov joined #mojo
07:43 nicomen bpmedley_: sorry late answer, but where was the code to look at?
07:54 arthas joined #mojo
08:09 nic sri: My change is kind of meta-use-case; it's to open up the way to future use cases
08:09 nic in between v2 and v3 we may want things like ->dequeue(.., {priority_at_least => 2})
08:10 nic in between v2 and v3 we may want things like ->dequeue(.., {lifo => !!1})
08:11 nic ::FileWithBells is just a playground, not for production
08:11 nic but backends like that can be a proving ground, easily exchanged between people without upsetting their real minion
08:12 vanHoesel joined #mojo
08:12 nic ->enqueue() already has an open api, so this is just bringing ->dequeue() in line
08:14 sri the fact that it encourages weird backends is an argument against it imo
08:15 sri unlike enqueue, dequeue has no optional arguments
08:15 sri so, there is no need for a hash
08:16 nic surely $timeout is optional
08:16 sri nope
08:16 * nic has only been playing with ::File
08:17 nic k, I'll drop the idea
08:18 nic seems a shame tho
08:18 Vandal joined #mojo
08:22 nic I might have a more convincing argument by the time we get to v3.0 :)
08:28 sri the timeout can be 0, but it's never optional
08:32 sri honestly, i don't think new dequeue features are very likely
08:32 nic fair enough, I completely agree with keeping minion simple
08:33 sri worst case, we make it ->dequeue(0.5, {foo => 1})
08:33 nic yeah, that's what I was proposing before the prospect of v2 came along
08:33 nic (cos it's non-breaking, obviously)
08:34 nic but it seems I misunderstood the role of $timeout, which has clouded the discussion a little
08:34 sri timeouts are such an essential part of the api, i don't see how making it optional would make sense either
08:34 nic fair enough
08:35 nic going that way makes the change a _lot_ simpler too
08:36 nic btw, in ::File, does $timeout behave more like $retry_delay ?
08:36 nic I didn't really follow why it was called 'timeout' since it looks like a sleep before a retry
08:37 nic and I don't think it stops the first attempt, so in constrast to a timeout, it would risk parallel attempts
08:37 sri the main implementation is the postgres backend
08:37 nic (but I realise I'm not well-versed in any of this)
08:37 berov left #mojo
08:38 sri it's a timeout in the sense "wait for this many seconds at most to get a job from the queue"
08:38 sri https://github.com/kraih/minion/blob/master/lib/Minion/Backend/Pg.pm#L17
08:39 nic In the ::File implementation I think it's more "wait at least this many seconds" if the first attempt fails
08:39 sri the postgres backend listens for pubsub notifications about new jobs for that long
08:39 sri the file implementation is fake
08:39 sri it only tries to imitate the postgres version
08:40 sri it's not actually very useful
08:40 nic I see.  I'm also trying to get my head around the ::mysql backend
08:40 sri i don't know the mysql backend
08:40 sri postgres is the one that matters
08:41 nic So...  I'll do more learning and playing, and come back with a stronger proposal in the future
08:47 sri allright, that leaves no open questions for 2.0
08:48 sri don't think i'll wait for too long with a release, so if anyone has more proposals, hurry up!
09:02 * sri is really happy the race condition is fixed :)
09:04 nic yeah, it's a big step forward
09:10 meshl joined #mojo
09:12 forke joined #mojo
09:13 forke morning, question. What is the best way to create a certificate base auth? each client get his own certificate and based on the certificate I see the user information
09:14 nic Does the Mojolicious app issue the certificates?
09:14 nic wow, he didn't hang around long
09:14 forke joined #mojo
09:15 nic forke: Does the Mojolicious app issue the certificates?
09:15 berov joined #mojo
09:15 forke yes
09:15 nic are the certificates small enough to fit in a cookie?
09:16 nic (it's not the only way, but probably the simplest)
09:17 nic one eg: could have certificate as a json record signed by the app in the usual way and transferred via the cookie in the usual way
09:17 forke Good idea. but , cookies are not my first choice
09:18 nic A more elaborate eg: Use jberger's JWT implementation; it's similar thinking but without da cookies
09:23 sue joined #mojo
09:28 nic sri: is the mojolicious github repo locked down now?
09:29 nic I can no longer "git clone http://github.com/kraih/mojolicious.git" without giving a github username
09:30 nic sorry, me being an idiot
09:30 nic (wrong path)
09:31 mattastrophe joined #mojo
09:33 mattastrophe joined #mojo
09:44 cpan_mojo JSON-Validator-0.56 by JHTHORSEN https://metacpan.org/release/JHTHORSEN/JSON-Validator-0.56
09:50 cpan_mojo Swagger2-0.57 by JHTHORSEN https://metacpan.org/release/JHTHORSEN/Swagger2-0.57
09:52 dotan joined #mojo
10:10 melo joined #mojo
10:28 asarch joined #mojo
10:33 bpmedley_ nic: The mysql backend copies the Pg backed in basically everything except the SQL
10:35 bpmedley_ nicomen: Sorry, I have some code; however, I've found some issues.  So, perhaps better to look at later?
10:35 nic yeah, which matters to me cos I'm fluent in MySQL but not Postgresql
10:35 bpmedley_ nic: I'd greatly appreciate any help with the mysql backend.  I'll try and answer any questions.
10:36 nic if I spot anything I'll be sure to let you know
10:36 nicomen bpmedley_: ok ;)
10:36 nic but I probably have to use (at work) a backend based on Mojar::Mysql
10:39 bpmedley_ nic: Perhaps you can copy the SQL from the mysql version and give your thoughts.
10:39 jontaylor joined #mojo
10:39 nic I'll certainly read it and discuss any comments :)
10:53 mtj joined #mojo
10:56 bpmedley_ forke: https://metacpan.org/pod/Mojolicious::Plugin::SslAuth <-- Will this help you?
10:58 Flying_Squirrel joined #mojo
10:59 mtj joined #mojo
11:10 damaya joined #mojo
11:12 asarch joined #mojo
11:18 dvinciguerra joined #mojo
11:19 cpan_mojo Mojolicious-Plugin-ReCAPTCHAv2-0.2 by HJANSEN https://metacpan.org/release/HJANSEN/Mojolicious-Plugin-ReCAPTCHAv2-0.2
11:22 Zoffix sweet
11:27 TheAthlete joined #mojo
11:28 TheAthlete left #mojo
11:31 forke bpmedley_; thanks and yes...
11:31 forke this is the correct plugin
11:33 TheAthlete joined #mojo
11:48 neilhwatson joined #mojo
11:50 asm35 joined #mojo
11:54 TheAthlete left #mojo
11:56 asm35 left #mojo
11:59 damaya joined #mojo
12:19 jberger forke / bpmedley_ : storing a jwt in a cookie is just using mojo's standard session but with extra overhead
12:22 bc547_ joined #mojo
12:22 bpmedley_ jberger: There's a little confusion.  I wasn't currently talking about jwt.
12:22 jberger bpmedley_: sorry, I just saw that
12:22 jberger s/ bpmedley_  / nic /
12:27 nic jberger: We weren't talking about combining them
12:28 nic but apart from the names, and the content, your comment is completely valid :D
12:30 jberger I built it so that I could do signed session like things but outside of where cookies work ;p
12:30 mtj joined #mojo
12:32 nic yeah, I know
12:44 klaus47 joined #mojo
12:45 klaus47 Hi, I'm trying to use content negotiation with respond_to for the first time and have found a behaviour I do not understand: Mojo seems to render all formats, not only the requested one.
12:45 klaus47 This is a minimal example of my problem: https://gist.github.com/anonymous/83be5a75d1a24c622915
12:45 klaus47 The output of './testapp.pl get /' is 'def', which can only mean both templates have been rendered.
12:45 klaus47 Is this a bug or a feature?
12:54 good_news_everyon joined #mojo
12:54 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/vccad
12:54 good_news_everyon mojo/master 36c7aa2 Sebastian Riedel: mention the default format
12:54 good_news_everyon left #mojo
12:54 Grinnz you ran $self->render_to_string to construct the argument list to respond_to, regardless of whether that string gets used for rendering
12:54 sri see commit
12:57 good_news_everyon joined #mojo
12:57 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/vccVF
12:57 good_news_everyon mojo/master 9647b65 Sebastian Riedel: mention the actual default value
12:57 good_news_everyon left #mojo
12:58 sri http://mojolicio.us/perldoc/Mojolicious/Controller#respond_to
13:01 klaus47 Ah, stupid me. Thank you for explaining the obvious.
13:02 klaus47 This argument to respond_to works as expected: json => sub { $self->render( json => { blah => $self->render_to_string( inline => '<%= shift @$col %>' ),
13:11 gryphon joined #mojo
13:11 ajr_ joined #mojo
13:16 hernan605 joined #mojo
13:28 hernan605 joined #mojo
13:41 jb360 joined #mojo
13:46 Flying_Squirrel joined #mojo
13:49 gorfel joined #mojo
13:59 fvox joined #mojo
14:08 shadowpaste "romel" at 217.168.150.38 pasted "sub add { my $self = shift; my" (26 lines) at http://paste.scsys.co.uk/499596
14:08 romel hi guys. can someone take a look?
14:10 jberger romel: attr creates an attribute
14:10 jberger it is not a setter
14:10 damaya joined #mojo
14:11 romel but the second argument is a default value, right?
14:14 asm35 joined #mojo
14:14 asm35 left #mojo
14:16 jberger it is
14:16 jberger but it installs the attribute on the package not the instance
14:16 jberger so every instance will have the value of the last loop iteration
14:16 romel oh i see
14:16 romel thank you very much
14:17 jberger just do $upload->path($path) instead
14:25 mattastrophe joined #mojo
14:26 damaya joined #mojo
14:27 berov Is there a Mojo plugin which allows me to search and browse Perl modules - an extension to the standart loclahost:3000/perldoc ?
14:27 berov I mean my local perl modules used to start my mojo app
14:28 berov in other words a search box wich will first search in all files found in @INC recursively
14:29 mattastrophe1 joined #mojo
14:29 berov the standart search box does a google search
14:32 berov so something like Mojolicious::Plugin::PODRenderer::Search
14:32 disputin joined #mojo
14:36 McA joined #mojo
14:38 Kogurr joined #mojo
14:44 ZoffixWork joined #mojo
14:49 jberger berov: I'm not sure what you mean, the PODRenderer plugin does only use you local pod
14:49 jberger *your
14:49 mattastrophe joined #mojo
14:50 berov jberger: I want to search into my Modules - thise which are in @INC
14:50 panshin joined #mojo
14:50 jberger oh, I thought it did that
14:50 berov ?
14:50 jberger I'm rereading now and I see that it does go to metacpan
14:50 berov yes
14:51 jberger no, it does
14:51 berov ?
14:51 jberger it uses your modules or else it redirects to metacpan
14:51 jberger https://github.com/kraih/mojo/blob/master/lib/Mojolicious/Plugin/PODRenderer.pm#L89-L92
14:51 berov the search box in the right top corner?
14:52 jberger ?
14:52 jberger no
14:52 berov oh yes, but the search box
14:52 berov is a form referring to google
14:53 berov https://www.google.com/cse
14:53 jberger right, that's not really part of the perldoc plugin
14:54 jberger https://github.com/kraih/mojo/blob/master/lib/Mojolicious/templates/mojobar.html.ep#L74-L78
14:54 jberger that's in the mojobar template
14:54 berov I was wondering if It is just a question of changing the template and adding an action which searches locally recursively and displays a list of what is found
14:54 jberger the perldoc plugin is meant to be instructive
14:54 jberger its not very extensible
14:55 berov but I could change the template
14:55 jberger copy it and make it do what you want
14:55 berov I mean create another template
14:55 berov yes
14:55 berov thanks
15:03 meshl joined #mojo
15:12 hernan605 joined #mojo
15:18 asarch joined #mojo
15:28 jb360 joined #mojo
15:31 sh4 joined #mojo
15:32 PopeFelix When do I need to call finish() on a Mojo::Message::Request instance?
15:36 hernan606 joined #mojo
15:45 melo1 joined #mojo
15:49 PryMar56 joined #mojo
15:51 njlg joined #mojo
15:56 lluad joined #mojo
16:01 Flying_Squirrel joined #mojo
16:07 irqq joined #mojo
16:16 disputin joined #mojo
16:21 Kogurr joined #mojo
16:26 batman PopeFelix: that's a weird question.
16:26 batman i would say... never or right when you have to...
16:31 PopeFelix Looking at the source, it doesn't look like it's going to affect things much for my purposes.
16:50 Flying_Squirrel joined #mojo
16:50 disputin joined #mojo
16:55 ilbot2 joined #mojo
16:55 Topic for #mojo is now ???? cheers | http://mojolicio.us | http://irclog.mojolicio.us | http://code-of-conduct.mojolicio.us
17:07 cpan_mojo Future-Mojo-0.002 by DBOOK https://metacpan.org/release/DBOOK/Future-Mojo-0.002
17:22 ashimema joined #mojo
17:29 trone joined #mojo
17:41 Onigiri So I'm mildly confused by JSON::XS & Mojo::JSON. When using a time::moment object, JSON::XS claims no to_json on it, doesn't Mojo::JSON use to_json as well? o_O
17:41 amon joined #mojo
17:42 jberger TO_JSON
17:42 Grinnz_ TO_JSON is very different from to_json
17:42 Grinnz_ to_json is a function which you run on some data to convert it to json; TO_JSON is a method which an object provides to return json-compatible data
17:43 Grinnz_ JSON::XS doesn't stringify objects that don't have TO_JSON, Mojo::JSON does
17:43 Grinnz_ see https://metacpan.org/pod/Mojo::JSON::MaybeXS#Object-Conversion and https://github.com/rurban/Cpanel-JSON-XS/issues/37
17:44 Onigiri TO_JSON does exist in Time::Moment, so my confusion remains
17:44 jberger perl -Mojo -MTime::Moment -E 'say j([Time::Moment->now])'
17:44 jberger wfm
17:44 mtths joined #mojo
17:44 Grinnz_ Onigiri: do you have the convert_blessed option set?
17:44 Grinnz_ it only uses TO_JSON with that
17:44 Grinnz_ it == JSON::XS
17:44 Grinnz_ (also, you should use JSON::MaybeXS instead)
17:46 Onigiri Grinnz_: I don't have the option set, the docs implied to me that it's not needed.
17:47 Grinnz_ how do they imply that? it explicitly says under convert_blessed that that option must be enabled to check for TO_JSON
17:47 Onigiri If $enable is true (or missing)
17:47 Grinnz_ ahh, that's just a bad phrasing
17:48 Grinnz_ if $enable is missing, i.e. you can $json->convert_blessed; it assumes you wanted to enable it
17:48 Grinnz_ so "missing" counts as enabled
17:48 Grinnz_ but the default is false
17:48 Grinnz_ thats just how JSON::XS options work..
17:51 jberger the warning is equally bad
17:51 jberger encountered object '2015-09-30T12:45:31.687506-05:00', but neither allow_blessed, convert_blessed nor allow_tags settings are enabled (or TO_JSON/FREEZE method missing) at -e line 1.
17:51 jberger I read that as "if there was a TO_JSON, the other conditions are moot"
17:51 Grinnz_ it's correct though... convert_blessed and allow_blessed werent enabled :P
17:52 Onigiri Yeah, that was my reading of that as well.
17:52 jberger soo... who's going to file a doc bug with schmorp
17:52 Grinnz_ it's a complicated decision tree... if you have convert_blessed enabled, but there's no TO_JSON, you also get that error
17:52 * jberger hides
17:52 Grinnz_ point is, just use Mojo::JSON::MaybeXS which enables these things so it's mojo like :D
17:52 Onigiri Now how do I enable convert_blessed and still be able to just use the functional methods? >_>
17:52 jberger when wouldn't you want convert_blessed?
17:53 Grinnz_ legacy code that's relying on things blowing up on objects i guess?
17:53 jberger "this object tells me what to do on jsonify, but I'm just going to die instead" that's silly
17:53 Onigiri Grinnz_: I was attempting to not pull in any new dependency for this old script.
17:54 Grinnz_ Onigiri: with Mojo::JSON::MaybeXS, or copying what it does into your own functions
17:54 jberger damn to the blazes legacy code
17:54 jberger pin your dependencies
17:54 Grinnz_ jberger: sadly not everyone has that view :P
17:54 jberger I still have yet to see these companies that depend on ancient code and yet upgrade to blead modules from CPAN
17:54 Grinnz_ Onigiri: its like 5 lines ;)
17:55 jberger everyone worries about them, but I suspect they are unicorns
17:55 jberger not like our unicorns, they're the creepy ugly unicorns
17:55 jberger ours are cute
17:55 Grinnz_ jberger: i suspect rurban and ribasushi would know more, they're the ones who want stuff to run on 5.6 :P
17:56 jberger ribasushi and I talk about it often
17:56 jberger we agree to disagree (strongly) and then have a beer
17:56 * jberger waves at ribasushi
17:56 Onigiri If I were sticking with an older perl, it would be before smartmatch got flagged experimental.
17:57 Grinnz_ if you want to use smartmatch in a not footgun way, try Smart::Match
17:57 Grinnz_ it lets you explicitly state how you're trying to match something
17:58 Grinnz_ without having to write out what may be excessive boilerplate if you didnt use smartmatch
17:58 * jberger just excised the last smartmatch from $work_codebase
17:58 Grinnz_ it's a cool idea
18:09 PopeFelix How can I generate a mock HTTPS app?
18:10 PopeFelix I would guess it would be somewhere in Mojo::UserAgent::Server, but I haven't been able to find where.
18:11 batman PopeFelix: perl -Mojo -e'app->start' daemon --listen https://*:4443
18:11 PopeFelix I need this inside a unit test.
18:12 jberger what would you be testing?
18:12 jberger its just transport
18:12 batman my $t = Test::Mojo->new; $t->app->routes->any("/mocked")->to(cb => sub { shift->render(text => "you're welcome") });
18:13 PopeFelix Testing that when I serialize a request, the scheme is stored as well as everything else.
18:14 batman PopeFelix: have you looked at https://metacpan.org/pod/Test::Mojo or https://metacpan.org/pod/distribution/Mojolicious/lib/Mojolicious/Guides/Tutorial.pod ?
18:15 PopeFelix I've looked at the tutorial.  Not using Test::Mojo.
18:15 PopeFelix no real reason not to, i just haven't been.  I'm not testing GET/POST/whatever, but that when I store a transaction, the reconstituted version of same is identical to the original.
18:16 jberger PopeFelix: http://mojolicio.us/perldoc/Mojo/UserAgent/Server#url
18:17 PopeFelix jberger, I'm looking at that now.
18:18 PopeFelix jberger, yes, thanks. That's what i need.  I was trying $server->url->clone->scheme('https') and it wasn't working.
18:19 PopeFelix Odd that the URL is the same in either case. I guess $server->url('https') must tell the app server to listen to HTTPS or something.
18:28 cpan_mojo Mojo-PDF-1.004002 by ZOFFIX https://metacpan.org/release/ZOFFIX/Mojo-PDF-1.004002
18:34 Martin90 joined #mojo
18:35 Martin90 is there recommend OO system to work with mojolicious ? core/moo/moose ?
18:36 genio I've never encountered HTML in POD before...
18:36 Grinnz_ generally, Mojo::Base, or Moo if you want triggers/coercion/roles/other things
18:37 Grinnz_ genio: https://metacpan.org/pod/Dist::Zilla::Plugin::Pod::Spiffy
18:37 Martin90 yes I need full functionality
18:37 Martin90 what about moose and core OO ?
18:37 Grinnz_ Martin90: then Moo, i use it in several mojo related projects
18:38 batman Martin90: if you don't need $class->meta, but all the other goodness then use Moo
18:38 PopeFelix How do Moo(se) and Mojo's "has" interact?
18:38 Grinnz_ not using any of those is just hamstringing yourself, i only do that in very specific circumstances (object that doesnt really have any attributes, etc)
18:39 * batman stopped using Moo*
18:39 * PopeFelix loves Moo*
18:39 batman i found myself using cool features that wasn't really needed
18:39 Grinnz_ PopeFelix: they don't really... you should use one or the other
18:39 * PopeFelix nods
18:39 PopeFelix That's kinda what i thought.
18:39 Grinnz_ they both create an attribute that ends up in the same place, so there's that
18:40 batman Grinnz_: huh? Mojo::base::has() just ends up as a method. works like a charm
18:40 PopeFelix someone should write Moo*jo. ;)
18:40 batman but you can do $class->meta->get_all_attributes() and get the mojo has() attributes
18:40 jberger you can use Moo(se)? in your mojo apps
18:41 jberger Grinnz_: why the doubt?
18:41 Martin90 would you definitely discourage to core OO ?
18:41 jberger the only oddity is the type of accessor that is created changes depending on which toolkit built it, but they work together
18:41 stryx` joined #mojo
18:41 Grinnz_ right, thats all i meant
18:41 batman Martin90: what is core oo?
18:41 Martin90 perl core objects
18:42 Martin90 without anything on top
18:42 batman Martin90: everything is based on that
18:42 batman yeah. don't use core objects if you have some other tool available
18:42 Martin90 I know, but to use it withou object framewrok ;p
18:42 batman i do core objects when it's _very_ simple
18:42 jberger Martin90: I call those POPOs (plain old perl objects)
18:42 Martin90 that's what I was thinking
18:42 batman i got some modules with bless {}, but not many...
18:43 jberger Mojo::Base is a very thin layer over that
18:43 Martin90 now I wonder wheter choose moo or moose, can you help decide ? ;p
18:43 batman i even use Mojo::Base most of the time, even if it's small
18:43 Grinnz_ just use Moo
18:43 jberger Moo unless you NEED Moose
18:43 batman i would say Mojo::Base or Moo
18:43 Grinnz_ if you need Moose features, it will upgrade to Moose automatically
18:43 Grinnz_ you probably don't need Moose features
18:43 batman or just Moo if you don't have Mojolicious
18:44 Martin90 since I am here, I plan to work with mojolicious =)
18:44 batman Martin90: if you don't know what you need and this is a mojo project, then use Mojo::Base
18:45 batman so... the complexity order is POPO, Mojo::Base, Moo, Moose
18:45 batman the same order goes for number of dependencies, time to install, ...
18:45 Martin90 what do you guys mean by "you can easly update moo to moose" ? Is it really that 'simple' and 'right away' ?
18:45 Grinnz_ yes. did you read the docs i linked before :)
18:45 jberger that is what Moo did better than Mouse, which is no longer recommended
18:45 Grinnz_ https://metacpan.org/pod/Moo#MOO-AND-MOOSE
18:46 batman yes. it is. if you do My::Moo::Class->meta, then it will try to load in Moose or whatever that can provide the extra functionality you need
18:46 Martin90 Grinnz_, thanks
18:46 Martin90 mhm thank you guys ;)
18:53 mattastrophe joined #mojo
18:54 PopeFelix I had to use POPOs at my last job. Boss was anti everything that hadn't been developed in the mid nineties.
18:55 PopeFelix We were still on CGI, for pete's sake.
18:55 Grinnz_ thats why you copy-paste Mojo/Base.pm into MyApp/Base.pm
18:55 Grinnz_ <_<
18:56 PopeFelix Grinnz_, now there's an idea. ;)
18:56 Grinnz_ s/why/when/
18:56 PopeFelix But I'm out of that job now, and thankfully. No more fighting with the boss over using a module vs. re-implementing it ourselves.
18:58 Martin90 jberger, sorry but why do you thnk: moose is no longer recommended ?
18:58 jberger Mouse is no longer recommmended
18:58 * batman copy/paste Mojo::Base::new() whenever i do "my own thing" :)
18:58 jberger Mo -->u<--- se
18:58 Martin90 ahh sory ;)
18:58 Martin90 my eays are tired.. :P
18:58 jberger Moo is essentially a replacement for Mouse that works with Moose better
18:58 Martin90 eyes*
18:58 batman i wonder how many LoC Moose is now......
18:59 jberger Martin90: hehe, nice meta-typo
18:59 Grinnz_ https://metacpan.org/pod/Perl::Critic::Policy::Freenode::DiscouragedModules#Mouse
19:00 Martin90 Grinnz_, thanks.
19:06 asm35 joined #mojo
19:10 irqq joined #mojo
19:16 panshin joined #mojo
19:23 Martin90 joined #mojo
19:24 Mattes joined #mojo
19:25 Mattes Hello
19:27 PopeFelix Hello.
19:27 bpmedley_ Mattes: Howdy
19:28 Mattes i worked with Mojo 5.39 (so far).
19:28 Mattes i updated today to version 6.22
19:28 Mattes but now my code dont work
19:28 Grinnz_ https://github.com/kraih/mojo/wiki/Upgrading
19:28 Mattes i upgraded over cpan
19:28 Mattes i use moja:dom
19:29 Mattes mojo:dom
19:29 Grinnz_ yes, look at that page
19:29 jberger Mattes: Mojo::DOM got quite a face-lift at 6.0
19:29 Mattes one moment plz
19:29 Mattes i will pubish my code
19:30 jberger Mattes: please consult the Upgrading document first
19:30 jberger much of the face-lift was renaming methods to make them consistent and better self-documenting
19:31 jberger then if the obvious fixes aren't enough, then perhaps we can help
19:32 Mattes http://pastebin.com/hSkTScvW
19:32 Repaster Repasted text from Mattes: http://fpaste.org/273308/41541144/
19:32 Flying_Squirrel joined #mojo
19:32 ZoffixWork joined #mojo
19:32 pink_mist Mattes: so you looked through the wiki page and none of that helped?
19:32 Mattes i cant find->('strong)
19:33 Mattes if ($_->find('strong') =~ /Sprachen/) {
19:33 Mattes one moment plz - i look
19:33 ZoffixWork Mattes, you're looking for strong within strong and your markup doesn't have that
19:33 Grinnz_ $ perl -MMojo::DOM -E'say Mojo::DOM->new("<strong>foo</strong>")->find("strong")->first->text'
19:33 Grinnz_ foo
19:33 Grinnz_ works for me
19:34 Grinnz_ yeah, logic problem
19:34 ZoffixWork Mattes, perhaps you meant:    if ( /Sprachen/ )
19:35 Mattes http://pastebin.com/hSkTScvW
19:35 Repaster Repasted text from Mattes: http://fpaste.org/273310/41701144/
19:35 Mattes this woks in mojo 5.30 without problems
19:35 Mattes 5.39
19:35 Mattes if ($_->find('strong')->first =~ /Sprachen/) {
19:35 Mattes this i never true
19:35 Mattes i dont know why!
19:36 Grinnz_ because $_ is already the strong tag
19:36 Grinnz_ it does not contain any strong tags
19:36 Mattes hmmm
19:36 Mattes i use this ever in Mojo 5.39
19:37 Mattes and it worked
19:37 Mattes sorry - i am a beginner
19:37 Grinnz_ then there was a bug in 5.39
19:38 Mattes my @details2 = $dom->find('strong')->each;
19:38 Mattes say @details2;
19:38 Mattes strong-tag is inside $_
19:38 Mattes its no bug
19:39 Grinnz_ the strong tag *is* $_
19:39 Grinnz_ of course it's there
19:39 bpmedley_ Mattes: http://pastebin.com/raw.php?i=hSkTScvW <-- This has a number of spaces in it.  Would you fix pls?
19:39 Repaster Repasted text from bpmedley_: http://fpaste.org/273314/36419491/
19:39 ZoffixWork Mattes, It seems it's just a detail of how the new Mojo::DOM handles it. The root node is different. This works for example: perl -MMojo::DOM -E'say Mojo::DOM->new("<strong>foo</strong>")->find("strong")->first->parent->find("strong")->size
19:39 Grinnz_ but ->find operates on the descendant elements
19:40 bpmedley_ Mattes: Nevermind, it was chrome.  They translated it.
19:40 Mattes puuh
19:40 ZoffixWork Mattes, it's more logical.
19:40 Mattes was this in Mojo 5.39 otherwise?
19:40 ZoffixWork Mattes, and it cleans up your code too. Just change that if to    if ( /Sprachen/ ) {}
19:41 Mattes i have over 100 extraction-templates written .... with tis i spider over 100 websites and extract content from there
19:41 Mattes in 5.39 all worsk correct - after upgraed to 6.22 only errors
19:41 PopeFelix Mattes, you've made that extremely clear.
19:41 ZoffixWork Mattes, yes. A lot has changed between those versions.
19:43 shadowpaste "PopeFelix" at 217.168.150.38 pasted "Mattes, do this" (19 lines) at http://paste.scsys.co.uk/499622
19:44 Grinnz_ my $ich_spreche = $dom->find('strong')->first(qr/Sprachen/);
19:44 Kogurr joined #mojo
19:44 ZoffixWork :o
19:45 Mattes #shadowpaste: Your code works
19:45 Mattes thx
19:45 * ZoffixWork lols
19:45 jberger shadowpaste is a bot, the code was from PopeFelix
19:45 Mattes but .. i must change over 100 extractiox templats now
19:45 PopeFelix All glory to shadowpaste !
19:45 Mattes this i shit
19:45 ZoffixWork CSS needs a "contains this text" selector
19:45 PopeFelix nein!
19:45 batman_ joined #mojo
19:45 Mattes i need weeks for this
19:45 jberger Mattes: then don't upgrade
19:46 PopeFelix night cussing.  I don't know how to say cussing auf Deutsch.
19:46 Mattes i need function "text_after"
19:46 PopeFelix dangit
19:46 Mattes in Mojo 5.39 this function is not available
19:46 Mattes darf man hier auch deutsch sprechen?
19:46 PopeFelix nicht cussing, not "night" cussing.
19:46 PopeFelix nur ein bisschen
19:47 PopeFelix that's right, isn't it?  "only a little"?
19:47 ZoffixWork sri is sprechen
19:47 ZoffixWork :)
19:47 forke joined #mojo
19:47 Mattes i what version was "text_after" first?
19:47 Mattes in
19:47 PopeFelix sri nicht spreche jetzt.
19:48 PopeFelix did my mac just realize i was trying to type in german?
19:48 ZoffixWork Mattes, I see that only being removed, not added.
19:48 Grinnz_ text_after was removed from Mojo::DOM long before 5.39
19:48 Mattes http://search.cpan.org/~ams/Mojolicious-4.26/lib/Mojo/DOM.pm#text_after
19:48 ZoffixWork Mattes, those docs are for version 4.26
19:48 Grinnz_ yes, that's "long before 5.39"
19:48 Mattes is this funvtion not in 6.22?
19:49 ZoffixWork No
19:49 Mattes omg
19:49 Grinnz_ that is what removed means
19:49 Grinnz_ perhaps you want child_nodes, or children
19:49 Mattes sorry - my mistake
19:49 pink_mist Mattes: http://mojolicio.us/perldoc/Mojo/DOM <-- these are the current docs
19:50 Mattes ok - thx
19:50 Mattes plz look
19:50 Mattes http://paste.scsys.co.uk/499622
19:50 Mattes how can i find the text after FIRST br (after <strong>Sprachen:</strong>)
19:51 Mattes <br>
19:51 Mattes <strong>Sprachen:</strong><br>Deutsch, Englisch (Fließend), Französisch (Konversation)<br>
19:51 Grinnz_ $dom->at('br')->next_node
19:52 Mattes one moment - i test it
19:53 ZoffixWork Mattes, http://fpaste.scsys.co.uk/499623
19:58 Grinnz_ or perhaps more robust, $dom->find('strong')->first(qr/Sprachen/)->following_nodes->first(type => 'text');
19:58 Grinnz_ whoops
19:59 Grinnz_ ->first(sub { $_->type eq 'text' })
19:59 pink_mist why not $dom->find('string + br')->...?
19:59 pink_mist err strong
19:59 Grinnz_ i don't know css that well :P
20:00 mattastrophe joined #mojo
20:00 mattastrophe joined #mojo
20:06 meshl joined #mojo
20:13 Mattes sorry - was offline a short time - feeded the rabbits
20:13 Mattes now i test it
20:14 * ZoffixWork wants to pet a rabbit now :(
20:16 Mattes #ZoffixWork - we have 9 ;-)
20:16 Mattes my fathers
20:17 Mattes he is in holiday and i  take care of them
20:18 Mattes next_node is not available in mojo 5.39?
20:18 Mattes hmmm
20:18 Grinnz_ it was next_sibling before
20:18 Mattes ah - thx - i will test
20:19 Mattes yeahhh - it works ;-)
20:19 Mattes THANK YOU! ;-)
20:19 Mattes so easy ;-)
20:20 Grinnz_ web scraping is all CSS and traversal
20:20 Grinnz_ find a certain point, then traverse to what you need
20:20 Mattes but why is the a sibling from "strong"? This i dont understand!
20:20 Grinnz_ it is the next node
20:20 Grinnz_ the new description at https://metacpan.org/pod/Mojo::DOM#NODES-AND-ELEMENTS may be helpful
20:21 Mattes thx
20:21 Mattes is it possible to use both version from mojo (5.39 and 6.22)?
20:21 Grinnz_ no
20:22 Mattes for my old templates i need 5.39
20:22 Mattes for new 6.22
20:22 Mattes hmmm
20:22 Mattes then i must rewrite all templates
20:22 ZoffixWork Mattes, http://perlbrew.pl/
20:22 Mattes over 100
20:22 Grinnz_ they would have to run as separate applications, probably easier to update them all
20:22 ZoffixWork Mattes, hm... Actually that's overkill
20:23 ZoffixWork Mattes, you can download a local copy of older Mojolicious for those apps and let them rot
20:23 Mattes hmmm
20:23 Mattes i am not a profi
20:23 Mattes its run all on my online-server
20:23 ZoffixWork Mattes, as for my perlbrew comment. I was gonna suggest installing a different perl and installing old mojo on it and just "use" that dif perl whenever you need to load those old apps with old mojos...
20:24 Mattes i spider a lot of websites
20:24 Grinnz_ its just a different version, you could do that with a local::lib
20:24 Mattes thx - i will read it
20:24 Grinnz_ but either way, it wouldn't work in the same application
20:24 Grinnz_ but i guess youre application is really just scripts
20:25 jberger sri: when using hypnotoad => { proxy => 1 } the proto is being used correctly, the port is being lost though
20:25 jberger is that nginx or is it mojo?
20:25 Grinnz_ the reverse proxy setting doesnt affect the port afaik
20:25 Grinnz_ just proto and addr
20:25 Grinnz_ could be wrong
20:26 jberger that would render url_for useless for me in this case :(
20:26 ZoffixWork Lemme try with my apache setup
20:26 jberger I have 443 for a typical ssl and 9443 for a "less strict" external service which can't handle modern cypher
20:27 jberger it needs absolute urls
20:28 Grinnz_ there is X-Forwarded-Port but mojo doesn't use that
20:29 batman jberger: https://metacpan.org/pod/Mojolicious::Plugin::RequestBase
20:30 Grinnz_ to support that innately, it would need to do something with remote_port like it does with remote_address
20:30 jberger Grinnz_ / sri: should it?
20:31 jberger batman: thanks, does that header need to be enabled or does it show up by default?
20:31 batman jberger: you set it to whatever you want in nginx
20:31 ZoffixWork jberger, works for me out of the box with Apache
20:32 batman I think it says so in the documentation even...
20:32 jberger batman: oh, you're right
20:32 jberger I went right to the code :p
20:34 batman There's so many I meet that doesn't bother to read the doc these days.
20:34 ZoffixWork And x-forwarded-host includes the port
20:34 batman Makes me less interested in writing any :(
20:34 mattastrophe joined #mojo
20:34 * batman goes extreme programming and let's you read the tests...
20:34 PopeFelix I write docs so I can remember what I promised.
20:35 batman Actually... I write docs so I know what to code.
20:35 ZoffixWork That's what tests are for! :D
20:35 PopeFelix Isn'
20:35 Grinnz_ doc-driven development :P
20:35 ZoffixWork :D
20:35 PopeFelix ZoffixWork, just what i was going to say. ;)
20:36 ZoffixWork left #mojo
20:36 PopeFelix Was it something I said? ;)
20:36 Grinnz_ lol
20:37 jberger batman: my apologies, I'm moving too fast
20:38 nic somebody strap him down!!!
20:38 batman jberger: but... url_for() and port..? I've never had the issue, since it only creates URL with the path
20:38 mattastrophe joined #mojo
20:39 batman So, /foo/bar tells the browser to use the host/port/scheme of the current page, when making a new request
20:39 Grinnz_ batman: not if its an abs url, like for websockets, i guess
20:39 jberger batman: this is for a phone system IVR
20:39 Grinnz_ thats where ive seen that done anyway
20:39 jberger it needs all abs urls
20:39 jberger because it isn't stateful enough
20:40 batman Oh. That's awful :(
20:40 batman Well then I think Marcus' plugin will help you
20:40 jberger we return XML which controls a phone system, some of those xml tags point to other routes but have to be absolute
20:41 bpmedley_ jberger: Is the phone system similar to Twilio?
20:41 jberger it might, or I might just use a similar thing using X-Forwarded-Host
20:41 jberger bpmedley_: kazoo
20:41 batman Or just hard-code $c->req->url->base in your app
20:41 Grinnz_ you could also do url_for('blah')->port(weee)
20:41 jberger Grinnz_: that's what we suddenly are having to do, but I don't want to
20:41 batman The nice part about using the header is that it's less tightly coupled
20:41 Grinnz_ yeah thats a bit ugly :)
20:41 jberger I've spend all this time decoupling (as batman just said)
20:42 batman Don't do what Grinnz_ suggested. Too much work and maintenance :(
20:43 batman Mojo::URL->base() is your friend
20:43 jberger exactly
20:43 bpmedley_ jberger: So, your exchange between servers is getting the port lost in translation?  Am I reading correctly?
20:43 jberger aaaaaand my server just went down !
20:44 jberger bpmedley_: yes
20:45 jberger this service has to connect to a non-standard port because we have to allow a lower ssl version
20:46 jberger because the service can't handle what we would prefer
20:46 jberger so we give them a special port
21:04 jberger can someone help me understand this: http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_set_header
21:04 jberger specifically: However, if this field is not present in a client request header then nothing will be passed. In such a case it is better to use the $host variable - its value equals the server name in the “Host” request header field or the primary server name if this field is not present:
21:04 jberger when is Host not set?
21:05 jberger $http_host seems to be what I want
21:06 jberger but I'm concerned about this warning
21:17 panshin joined #mojo
21:18 nicomen jberger: Host is not set when using HTTP/1.0
21:18 nicomen or not mandatory at least
21:20 jberger hmmmm, given how old this external system, who knows what they are requesting
21:21 Grinnz_ jberger: http://paste.fedoraproject.org/273376/48038144/ implementation of recognizing X-Forwarded-Port
21:22 Grinnz_ Host would be more complicated of course
21:25 jberger Grinnz_: I can't find X-Forwarded-Port in nginx doc tho
21:25 jberger even if we did handle it
21:25 Grinnz_ you would have to set it like X-Forwarded-Proto https://metacpan.org/pod/Mojolicious::Guides::Cookbook#Nginx
21:26 Grinnz_ with $proxy_port
21:26 Grinnz_ i think
21:26 Grinnz_ no thats what's proxied to
21:27 jberger http://stackoverflow.com/a/11484928/468327
21:27 jberger $server_port?
21:27 * jberger tries
21:27 Grinnz_ yeah that looks right
21:27 jberger yeah
21:28 jberger so in that case I can use what that SO post says
21:28 jberger $host:$server_port
21:28 jberger and actually, I can just do it in the non-standard conf
21:37 nicomen jberger: a quick grep on your logs should give you a pinpoint of HTTP/1.0 usage
21:37 jberger nicomen: thanks, but the more I think about this, it would already be breaking if it couldn't do this
21:39 nicomen used to be spiders and crawlers, but the ones you should care about would not use that. But some old proxies might insist on 1.0 for a simpler implementation
21:39 nicomen probably neglicheable
21:41 nicomen *neglectable
21:42 nicomen **negligible
21:43 nicomen <sleep>
21:47 bpmedley_ jberger: Did you settle on a solution?
21:49 jberger bpmedley_: yeah
21:49 jberger in the 9443 server I'm setting the Host to $host:$server_port
21:49 jberger I could just hard-code that I suppose, but meh
21:52 bpmedley_ Gotcha.  Do y'all have time to inspect an alternate approach for validity?
21:58 jberger sure
21:58 bpmedley_ https://bitbucket.org/snippets/bpmedley/98Rrx
21:58 jberger and I should say, thanks to all for the help/ideas/etc
21:59 jberger bpmedley_: that's essentially what's being done on the nginx side
21:59 jberger once it is proxied, the app wouldn't know what the original port is
21:59 bpmedley_ Understood.  Is it an accurate use of the Mojo API?
22:00 jberger hehe, actually I haven't ever injected headers that way, so I don't know
22:00 jberger there are some header rewriting examples in the docs, I know
22:00 jberger but its been a while since I've read them
22:00 bpmedley_ It's actually a CGI ENV var injection, I think.
22:00 * jberger runs screaming
22:01 jberger what I would do if I was going to do something like yours would be to do $c->req->url->base->port(12345)
22:01 jberger the big problem was how to get 12345 while behind the proxy, though
22:04 buu joined #mojo
22:05 jberger Grinnz_: your patch is nice and might be worth considering separately
22:05 Grinnz_ well, I don't have an use case for it, so it's really up to whether someone else does :P
22:06 disputin joined #mojo
22:06 jberger true
22:06 Mattes provides a "Krug Bier" in the Round ;-)
22:06 tim joined #mojo
22:06 jberger Mattes: ????
22:07 preaction is there a way to test that a websocket message is _not_ received by a given timeout? or perhaps that a websocket message isn't ready on the socket right now? i've got some patterns that i need to ensure aren't sending messages to certain clients
22:07 panshin joined #mojo
22:09 tim Hi,
22:09 tim when Mojo::UserAgent receives an HTTP redirect with an invalid Location header, it generates the following warning:
22:09 tim "Use of uninitialized value $host in concatenation (.) or string at .../Mojo/UserAgent.pm line 187"
22:09 tim Example script: http://pastebin.com/jStaPHAACan we fix this?
22:10 tim +Can
22:10 tim http://pastebin.com/jStaPHAA
22:10 Repaster Repasted text from tim: http://fpaste.org/273391/51028144/
22:13 jberger tim: why are you using Mojo::IOLoop->server?
22:13 Grinnz_ i think he was just constructing a test case
22:13 jberger ah
22:14 tim right
22:14 jberger I guess that makes sense, sorry
22:14 panshin joined #mojo
22:15 jberger tim: so what should it do in that case?
22:15 jberger it can't follow the redirect
22:15 Grinnz_ the basic problem is at https://metacpan.org/source/SRI/Mojolicious-6.22/lib/Mojo/UserAgent/Transactor.pm#L28 , $host is the only one that dosn't have a default
22:16 Grinnz_ defaulting to empty string wouldn't be worse than the current handling, i guess
22:17 tim it should ignore the location header and don't try to follow the redirect
22:19 jberger this is where I BELIEVE that that is supposed to be happening: https://github.com/kraih/mojo/blob/master/lib/Mojo/UserAgent/Transactor.pm#L74-L78
22:19 Grinnz_ yeah, looks like it
22:19 jberger tim: is your Mojolicious current?
22:19 jberger line 187 in UA.pm is a strange place to see that then
22:20 Grinnz_ jberger: "http:" counts as an absolute URL
22:21 jberger hmmmm, yes ...
22:21 Grinnz_ so it just sets that as the $req->url and then eventually tries to use it '
22:21 tim I just updated to 6.22 and the warning is still there
22:21 jberger tim: see Grinnz_ ^^
22:22 jberger no location header it handles, a location header that is technically valid but useless, it does not
22:22 Grinnz_ maybe "return undef unless ($proto eq 'http' || $proto eq 'https') && $location->ihost;"
22:22 jberger if you'd like to handle it on your own, I could try to give you some code
22:23 jberger that is basically the pathological case for this code though
22:23 jberger tim: interesting find
22:24 jberger I'm torn honestly, literally that is like the only value that could cause it
22:24 jberger is checking for that worth slowing down all redirects?
22:24 oetiker joined #mojo
22:25 tim I found this warning in my logs and tried to reproduce it :)
22:25 jberger http://x would be enough to have to try I think
22:25 jberger htt wouldn't pass the existing code
22:25 Grinnz_ $location->host is probably enough to check
22:26 panshin joined #mojo
22:26 jberger preaction: back to your question, I would just set a secondary timer and stop the loop after a bit
22:27 jberger remember that message_ok starts/stops the loop internally
22:27 pink_mist the location header can be relative ... so it might just be a relative path .. not even any need for a host
22:28 Grinnz_ pink_mist: it turns it into an abs path if it's relative
22:28 Grinnz_ however, the presence of the scheme makes it absolute
22:28 Grinnz_ even with the rest being empty
22:33 panshin joined #mojo
22:42 berov1 joined #mojo
22:50 PopeFelix So as part of Mojo::UserAgent::Mockable, I'm recording transactions on the transaction "finish" event.  This is causing the requests to have several more headers than when the transaction starts.
22:51 PopeFelix As I'm comparing requests not just by URL, but by headers as well, this is causing requests to fail to match.  Is there a better time to record the transaction or compare the request to the stored transaction?
22:55 meshl joined #mojo
23:07 meshl joined #mojo
23:16 meshl joined #mojo
23:17 PopeFelix My mock UA is also not setting cookies in playback mode (i.e. when it plays back recorded transactions).
23:28 meshl joined #mojo
23:38 meshl joined #mojo
23:48 meshl joined #mojo
23:52 geheimnis` joined #mojo
23:57 meshl joined #mojo

| Channels | #mojo index | Today | | Search | Google Search | Plain-Text | summary