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

IRC log for #mojo, 2015-01-13

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

All times shown according to UTC.

Time Nick Message
00:12 jnbek joined #mojo
00:15 mattp joined #mojo
00:20 absolut_todd joined #mojo
00:51 jonquest joined #mojo
00:55 asarch joined #mojo
01:03 good_news_everyon joined #mojo
01:03 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/Vav61w
01:03 good_news_everyon mojo/master 3b7f5d8 Sebastian Riedel: mention that the server process is automatically daemonized
01:03 good_news_everyon left #mojo
01:05 rem_lex joined #mojo
01:08 bjakubski joined #mojo
01:25 rem_lex|pivo joined #mojo
02:13 * sri wonders how this criticism of http/2 will get shot down http://lists.w3.org/Archives/Public/ietf-http-wg/2015JanMar/0106.html
02:23 Adura It's turning out more like a movie sequel than a video game sequel.
02:35 klapperl_ joined #mojo
03:26 alnewkirk joined #mojo
03:27 noganex joined #mojo
03:30 jberger is there an easy way to create a user agent with the same session cookie as the current request?
04:22 zivester joined #mojo
05:13 dotandimet joined #mojo
05:17 irq joined #mojo
05:34 hshong joined #mojo
06:06 dotandimet joined #mojo
06:18 neyasov joined #mojo
06:39 dotandimet joined #mojo
06:44 batman jberger: can you rephrase?
06:45 batman Do you mean how you copy from chrome to Firefox, or is it a security question "is it possible?"
06:56 dod joined #mojo
07:01 dod joined #mojo
07:11 reneeb joined #mojo
07:26 Vandal joined #mojo
07:41 reneeb joined #mojo
07:46 batman sri: i'm +1 on closing this as "invalid" or something: https://github.com/kraih/mojo/issues/729
07:50 sugar joined #mojo
07:55 basiliscos joined #mojo
08:18 eseyman joined #mojo
08:21 trone joined #mojo
08:23 basiliscos joined #mojo
08:28 dp_ joined #mojo
08:28 davido_ joined #mojo
08:55 fhelmberger joined #mojo
09:23 irq joined #mojo
09:24 Eddy joined #mojo
09:24 hshong joined #mojo
09:47 dod joined #mojo
10:24 Eddy joined #mojo
10:34 denis_boyun joined #mojo
10:45 dod joined #mojo
11:02 Eddy joined #mojo
11:13 neyasov joined #mojo
11:24 sugar_ joined #mojo
12:04 uniejo joined #mojo
12:24 neyasov joined #mojo
12:27 asarch joined #mojo
12:30 neyasov joined #mojo
13:12 neilhwatson joined #mojo
13:24 hernan604 joined #mojo
13:27 dotandimet joined #mojo
13:28 Shaeto joined #mojo
13:48 Shaeto left #mojo
14:06 denny joined #mojo
14:09 marty joined #mojo
14:28 zivester joined #mojo
14:46 michael joined #mojo
14:49 dvinciguerra joined #mojo
15:05 jnbek joined #mojo
15:10 juikuen joined #mojo
15:13 trone I would add a specific header just to specific routes. Where can I put the res->headers->header('Access-Control-Allow-Origin' => '*') code ?
15:14 trone Can I my $r = $self->routes; my $new_path = $r->get('/a/new/path')->to(cb => sub { ... res-> headers->header(ACAO => '*') ... }); $new_path->get('endpoint')->to('some#thing') ?
15:15 trone I made a test, but I believe the cv in $new_path is breaking something
15:15 crab perhaps you want a bridge
15:17 trone crab: mmm. yep, right point! thx
15:18 trone crab++ # thx, solved. :)
15:24 reneeb joined #mojo
15:24 Grinnz you could also do what you said initially, but using "under" on the parent route
15:24 Grinnz and the other route would be /endpoint
15:25 sh4 joined #mojo
15:27 crab that is a bridge
15:28 Grinnz i havent used the bridge method itself, didnt know :)
15:30 sri crab: we don't use the word bridge anymore
15:31 sri literally, it's been removed from the docs completely
15:31 sri Grinnz: you're not supposed to anymore ;p
15:32 sri so it works \o/
15:32 Grinnz heh
15:37 mst BRIDGE DECLARED DOUBLEPLUSUNGOOD CRIMETHINK
15:39 crab what are they supposed to be called now?
15:41 crab intermediate destination
15:41 crab heh
15:44 jberger crab: that's a good question, calling it an "under" is just strange
15:45 jberger batman: thanks for replying, but in the end I think I shouldn't be doing what I was doing
15:47 sri jberger: nobody has complained yet
15:48 sri i remember bringing it up like 5 months ago
15:48 sri now it's "an under"
15:48 genio I most likely don't yet understand enough, but when doing challenge-response authentication (like NTLM) with Mojo::UserAgent, how would I go about seeing previous information to check the handshake?  I'm attempting to make an LWP::Authen::NTLM esque UserAgent in Mojo.
15:48 jberger yeah, I remember, but in the meantime, I have found myself referring to it as a bridge and you create a bridge with "under"
15:48 jberger :/
15:48 sri jberger, crab: if you two want to change it now... make a real proposal and collect votes
15:49 jberger the thing is, I don't know what it should be called, and for lack of inspiration, "under" works
15:49 Ptolemarch joined #mojo
15:49 crab if you call it a "bridge", trolls might come to live under it
15:50 sri we could actually deprecate the bridge method too
15:51 sri it's not used in the framework anymore for anything
15:52 sri not even the under method uses it internally
15:52 jberger sri: if that's really true, then I would support that
15:52 crab if it's not used, and not mentioned in the documentation, then it should be removed.
15:52 Grinnz "layover"? "transfer"? "stop at cvs to pick up milk"?
15:56 Grinnz i think "bridge" makes the most sense linguistically, but with bridge being an actual method (and not the one you should use) woul dbe confusing
15:56 mst I think 'under' is a better method name and 'bridge' is a more useful term for the thing constructred
15:57 aitap joined #mojo
15:57 jberger mst: agreed, but what do you call the structure you have now created?
15:57 jberger "an under"?
15:57 Grinnz he just said, "a bridge" :P
15:57 mst exactly.
15:57 jberger oh, shit
15:57 jberger I misread
15:58 mst so get rid of the bridge *method*, keep the term, all good
15:58 jberger mst: indeed that's kinda what I do
15:58 odin22 joined #mojo
15:59 jberger my only thought if it was to change would be to use something more meaningful like "sub_route" or something
15:59 jberger I would have liked "child_route" but children already has a different meaning
16:00 jberger eh, "use under to create a bridge" is fine
16:00 Grinnz well, keep in mind also, you still need terminology to describe child routes that aren't unders
16:01 asarch joined #mojo
16:01 aitap Hi! I have a bunch of large files in a directory which I would like to serve under certain conditions. I wrote a controller to check for these conditions and now I need to tell Mojolicious to serve a file from a specified path. The obvious $c->reply->static($abs_path) doesn't work (404) because apparently it wants a filename relative to $proect_root/public/. I can't just put them in /public/ because the conditions won't be checked this way. How do I ask Mojolic
16:01 aitap ious to serve a static file from a specified absolute path?
16:02 nicomen you can set another public directory?
16:02 nicomen http://mojolicio.us/perldoc/Mojolicious/Static#paths
16:02 good_news_everyon joined #mojo
16:02 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/_et1iQ
16:02 good_news_everyon mojo/master 4701608 Sebastian Riedel: deprecated Mojolicious::Routes::Route::bridge in favor of Mojolicious::Routes::Route::under
16:02 good_news_everyon left #mojo
16:02 Grinnz $app->static->paths
16:02 aitap nicomen, Grinnz: but then the files will be accessible by their names while I want only my controller to access them
16:03 nicomen I don't think so, just don't alter the default Static object used in the app?
16:03 sri the term bridge no longer appears anywhere
16:03 Grinnz aitap, you could $c->reply->static with a path including .. to go to parent dirs
16:04 nicomen did you also try an absolute path?
16:05 aitap nicomen, yes, it 404'd. "File "/srv/path/to/file.7z" not found, public directory missing?"
16:06 sri http://mojolicio.us/perldoc/Mojolicious/Guides/Rendering#Custom-responses
16:07 odin22 joined #mojo
16:07 good_news_everyon joined #mojo
16:07 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/uynGSw
16:07 good_news_everyon mojo/master 5bf5ad8 Sebastian Riedel: fixed typo in rendering guide
16:07 good_news_everyon left #mojo
16:09 Grinnz that works too
16:10 aitap sri, Thanks! Just what I needed.
16:14 rshadow joined #mojo
16:14 rshadow hi
16:15 rshadow I have a question.
16:16 rshadow about Mojolicious::Validator
16:16 sri jberger, crab, mst: for the record, this is how we currently introduce the concept http://mojolicio.us/perldoc/Mojolicious/Lite#Under
16:17 rshadow Мне нужно чтобы определенный параметр всегда возвращался как массив. Если параметр не передан, то должен быть пустой массив.
16:17 sri the rendering guide then adds some details http://mojolicio.us/perldoc/Mojolicious/Guides/Routing#Under
16:17 rshadow I need to a certain parameter is always returned as an array. If the parameter is not passed, there must be an empty array.
16:17 sri rshadow: this is an english language channel
16:17 rshadow sri: yes
16:20 rshadow I can write:
16:20 rshadow I can write:
16:20 rshadow $c->validation->optional('a');
16:20 rshadow my $a = $c->validation->param('a');
16:21 rshadow $a //= [];
16:21 rshadow $a = [ $a ] unless 'ARRAY' eq ref $a;
16:21 rshadow But want something:
16:21 rshadow $c->validation->optional('a')->array;
16:21 rshadow my $a = $c->validation->param('a'); # always array
16:21 jberger rshadow: make a helper
16:22 jberger do it once and be done with it
16:22 sri actually, $a will never ever be an array
16:23 sri http://mojolicio.us/perldoc/Mojolicious/Validator/Validation#every_param
16:23 sri literally how every_param works
16:26 rshadow every_param ideal.
16:26 rshadow thanks
16:28 good_news_everyon joined #mojo
16:28 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/NuvMKA
16:28 good_news_everyon mojo/master 09499d4 Sebastian Riedel: use a little less code
16:28 good_news_everyon left #mojo
16:29 sri odd nobody noticed before that _param subs were totally useless
16:32 good_news_everyon joined #mojo
16:32 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/1i4gyg
16:32 good_news_everyon mojo/master fd82bfa Sebastian Riedel: removed another useless function
16:32 good_news_everyon left #mojo
16:35 denny left #mojo
16:37 Grinnz_ heh
16:51 jberger sri: I guess that was my bad
17:28 sri so this is what tempire has been up to lately? :o http://www.theverge.com/tldr/2015/1/13/7537345/ship-your-enemies-glitter
17:44 ua_ joined #mojo
17:48 neyasov joined #mojo
17:57 Ptolemarch joined #mojo
18:11 disputin joined #mojo
18:11 juikuen joined #mojo
18:14 basiliscos joined #mojo
18:52 dotandimet joined #mojo
18:58 irq joined #mojo
19:05 irq_ joined #mojo
19:09 Ptolemarch joined #mojo
19:10 * tempire might move to san diego
19:13 genio I've visited a couple of times and it seems like a nice place.
19:22 dotandimet1 joined #mojo
19:26 odin22 joined #mojo
19:43 t4nk139 joined #mojo
19:44 uniejo joined #mojo
19:47 t4nk139 question about Mojo::UserAgent: why doesn't POST body get included on 301 or 302 redirects, only on 307 or 308?
19:48 Grinnz_ joined #mojo
19:53 Ptolemarch joined #mojo
20:21 Trelane t4nk139: http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.2
20:22 Trelane "If the 301 status code is received in response to a request other than GET or HEAD, the user agent MUST NOT automatically redirect the request unless it can be confirmed by the user, since this might change the conditions under which the request was issued."
20:22 Trelane the spec says no
20:22 Trelane (same for 302)
20:26 badboy joined #mojo
20:26 badboy hi guys
20:26 badboy anybody up for challenge? :)
20:27 badboy read - a tricky question
20:28 badboy alright, i take silence for yes
20:29 badboy so, how can i make mojo helper to return a plain text with no HTML escpes?
20:29 badboy err escapes
20:30 Grinnz_ $c->render(text => $text)
20:31 Grinnz_ with format => 'html' if you still want it to be sent as text/html
20:33 badboy thank you Grinnz_, let me try
20:35 meredith for helpers you create, if you wrap your result in a Mojo::ByteStream before returning, the template won't try to html-escape a bytestream when substituting it into a <%= ... %> directive
20:36 Grinnz_ oh, if you're making a helper for templates yeah, you need to do something like that
20:36 Grinnz_ i was assuming you meant a rendering helper
20:37 meredith and i believe <%== .. %> turns it off for that specific tag
20:37 badboy thank you guys, wrapping it in ByteStream did it
20:38 badboy karma +50 to both of you :)
20:38 purl +50 to both of you :) has neutral karma
20:39 badboy that's good to know
20:39 badboy cheers
20:40 badboy left #mojo
20:41 t4nk139 Trelane: Thanks, that definitely explains it. I was looking at http://tools.ietf.org/html/rfc7231#section-6.4.2 which omits that particular explanation
20:42 Ptolemarch joined #mojo
20:55 neyasov joined #mojo
20:59 dotandimet joined #mojo
21:03 Ptolemarch joined #mojo
21:04 sri t4nk139: redirecting is actually a special case
21:04 sri actual browser behavior has precedence over the specs
21:05 sri since both don't always match
21:09 cfedde An0therB0x
21:10 cfedde
21:10 cfedde oops
21:10 sri :D
21:10 * sri hacks cfedde
21:11 cfedde heh
21:11 stl joined #mojo
21:12 cfedde good thig it's just the password on my r-pi
21:12 sri oh noes! that glitter as a service thing is alrwady down :(
21:12 cfedde was that a picture of you?
21:12 cfedde pretty awesome!
21:13 sri yea, that was me at mojoconf 2014 :p
21:14 hernan604 wheres that pic
21:14 purl that pic is funny tho =)
21:14 sri http://irclog.perlgeek.de/mojo/2015-01-13#i_9929816
21:15 hernan604 lovely
21:17 Grinnz_ lol
21:20 hernan604 seriously is there any your pic online sri ?
21:20 hernan604 im curious how much glitter you got =p
21:21 sri there are, but sadly i can't really pull off that glitter look :(
21:21 hernan604 hahah
21:23 sri that's me (supposedly looking like linus torvalds) on the couch https://twitter.com/bjoernfan/status/470591803159490561
21:23 sri coincidentally, tempire gave me a whole bottle of glitter that day :D
21:23 hernan604 http://25.media.tumblr.com/64433dee38e39520683b0411ea44dcf4/tumblr_n07j0ylYIj1rddbpso1_1280.jpg
21:23 hernan604 prefer this one
21:24 hernan604 aahaa
21:24 hernan604 nice =)
21:24 sri ok, that one is inappropriate for this channel
21:25 hernan604 badass meeting
21:26 hernan604 is that jberger with mojoconf tshirt?
21:28 jberger hernan604: yes, that's me in the pic from bjorn, I can't say that I would look good in that tank top :-)
21:30 jberger dotan is to my right
21:30 hernan604 so i guess thats bjorn right behind the camera
21:30 jberger riche is on my left (blue collared shirt)
21:30 jberger yep :-) , see the twitter pic for that guy
21:31 hernan604 :))
21:31 jberger and you can tell from the posture that it is jnthn to dotan's right (around the table corner) hunched over
21:31 sri there's also Akron in the foreground and nicomen behind jberger
21:31 jberger it really was a spectacular turnout
21:32 jberger sri: is it?
21:32 purl it's it!
21:32 Grinnz_ what is it?
21:32 purl it's it!
21:32 * jberger pushes purl down the stairs
21:32 purl Hey! *thump* ow! *bang* argh! *bam* son of a *thump* *crunch* whimper...
21:33 Grinnz_ just for having that i forgive purl for all previous botspam
21:33 jberger oh no! I've forgotten the name of the French guy, the one who really wanted to change the name of $delay->begin
21:33 hernan604 awsome!! hope i can join the next meeting :D
21:33 Grinnz_ i wanted to, but i'm not french nor did i go to that :P
21:35 jberger Grinnz_: I told you that you weren't the first
21:35 jberger damn, his name is on the tip of my tongue
21:35 jberger hernan604: http://joelberger.imgur.com/all/
21:35 Grinnz_ i haven't come up with anything better than $delay->continue :P
21:35 jberger hernan604: this is a better link: http://imgur.com/6Lggwve
21:36 Grinnz_ heh
21:36 jberger Grinnz_: nope, I disagree with that entirely :-)
21:36 hernan604 joelberger's images are not publicly available.
21:36 jberger ?
21:36 * sri is a disgrace for german foosball :(
21:36 jberger hernan604: try the pic link
21:36 Grinnz_ jberger: your first link was a link to all your images
21:36 jberger Grinnz_: yeah, I screwed that up
21:37 hernan604 jberger: and those are ??
21:37 Grinnz_ it says in the description :P
21:37 hernan604 aaah
21:37 hernan604 cool
21:37 hernan604 :D
21:45 Grinnz_ jberger: what about this one: $delay->queue
21:55 neyasov joined #mojo
22:00 sri for the record, $delay->begin exists because there used to be a $delay->end
22:00 Grinnz_ that would make more sense, heh
22:01 Grinnz_ as it is, the name seems discordant with what it's used for
22:01 sri i'm ok with it
22:01 sri my $end = $delay->begin;
22:01 sri $end->();
22:02 sri that's how i see it
22:02 Grinnz_ that doesn't make sense to me
22:03 Grinnz_ if you are implementing the nonblocking functionality yourself maybe, but usually it will be passed to something else
22:04 sri it's actually the first example http://mojolicio.us/perldoc/Mojo/IOLoop#delay
22:04 Ptolemarch joined #mojo
22:05 Grinnz_ the confusing part is that ->begin is doing both the beginning and returning the "end" as you call it
22:05 Grinnz_ where from my perspective, it's not beginning or ending anything
22:06 sri another fun fact, Mojo::IOLoop::Delay was originally called Mojo::IOLoop::Trigger
22:21 genio I've come to the conclusion that I'm an idiot.  Also, I hate NTLM
22:24 absolut_todd joined #mojo
23:09 odin22 joined #mojo
23:41 muraiki_ joined #mojo
23:52 cfedde ntlm is probably not worth using if you have AD (and ldap)
23:52 neyasov joined #mojo

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