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

IRC log for #mojo, 2014-06-08

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

All times shown according to UTC.

Time Nick Message
00:19 dgikiller joined #mojo
00:30 Lee joined #mojo
00:47 rem_lex|pivo joined #mojo
01:05 cpan_mojo Mojolicious-Plugin-MoreUtilHelpers 0.01 by sshaw - http://metacpan.org/release/SHAW/Mojolicious-Plugin-MoreUtilHelpers-0.01
01:34 klapperl joined #mojo
02:03 rem_lex|pivo joined #mojo
02:05 asarch joined #mojo
02:44 btyler joined #mojo
02:50 mport joined #mojo
03:22 dwierenga joined #mojo
03:38 jnbek^dt joined #mojo
03:40 basic6_ joined #mojo
03:43 jnbek^dt joined #mojo
04:21 disputin joined #mojo
05:27 btyler joined #mojo
06:16 Vandal joined #mojo
07:25 dod joined #mojo
07:46 dotan joined #mojo
08:58 rem_lex| joined #mojo
09:24 denis_boyun joined #mojo
09:28 voegelas joined #mojo
09:29 shmuel joined #mojo
09:38 denis_boyun joined #mojo
10:02 meshl joined #mojo
10:11 d4rkie joined #mojo
10:25 d4rkie joined #mojo
10:32 shmuel joined #mojo
10:35 punter joined #mojo
10:53 alnewkirk joined #mojo
10:53 dod joined #mojo
11:12 cpan_mojo Mojolicious-Plugin-Proxy 0.6 by Marcus Ramberg - http://metacpan.org/release/MRAMBERG/Mojolicious-Plugin-Proxy-0.6
11:21 dotan joined #mojo
11:27 shmuel joined #mojo
11:58 denis_boyun joined #mojo
12:28 d4rkie joined #mojo
12:52 denis_boyun_ joined #mojo
13:06 mport joined #mojo
13:08 punter joined #mojo
13:42 mire joined #mojo
14:02 gryphon joined #mojo
14:37 bc547 I experience some strange replies using mojo. If a client sends 1 request with just the normal http headers, mojo responds fine. But if the client sends quite a few extra information headers, mojo interprets the single request as 2 different requests it seems.  More info and wire traces on http://pastebin.com/5a09b89n
15:07 nicomen weird
15:11 sh4 joined #mojo
15:16 crab HATMainLocation
15:18 crab do you have a sanely formatted version of the request by any chance?
15:20 crab or maybe you can capture the whole thing with tcpdump -w?
15:20 crab that would be best.
15:20 nicomen bc547: ^^
15:25 crab e.g. with "tcpdump -i lo -w foo.tcp -s 16384 tcp port 3000"
15:25 crab adjust lo to the right interface, and port 3000 to the port your mojo app is receiving requests on.
15:27 crab 8080 i guess.
15:27 neyasov____ joined #mojo
15:28 neyasov_____ joined #mojo
15:40 bc547 crab: https://dl.dropboxusercontent.com/u/22805224/trace.pcap
15:50 bc547 this reverse proxy setup worked ok a half year ago. So the strange behavious was not yet present in 'old' mojo versions
15:59 * crab investigates
16:02 bc547 :-) tnx already
16:11 basiliscos joined #mojo
16:28 mire joined #mojo
16:30 crab so
16:30 crab i reduced that to this test case:
16:30 crab $a = "GET /main/index HTTP/1.1\r\no: \r\n\r\n";
16:35 crab bizarre though it may seem, that is handled correctly by 4.99 and mishandled by HEAD
16:36 crab when i type in the request in netcat, i see that "o: \r\n" already generates a response in HEAD without waiting for the empty line
16:37 crab and then the empty line by itself generates a response for GET /
16:39 dod joined #mojo
16:40 crab it doesn't have to be "o: ". any single-letter works. two letters doesn't work.
16:43 xantus joined #mojo
16:44 xantus hey guys
16:46 crab hmm. it seems it broke between 4.93 and 4.94 (sorry, my 4.99 test was broken)
16:47 bc547 crab: the version I tested with half a year ago was Mojolicious (4.55, Top Hat). So that fits the picture :-)
16:48 crab -    if ($line =~ /^([^:]+)\s*:\s*(.*)$/) { push @$headers, $1, [$2] }
16:48 crab +    if ($line =~ /^(\S[^:]+)\s*:\s*(.*)$/) { push @$headers, $1, [$2] }
16:48 crab that's the problem.
16:48 crab 5dce09139e6c6ea91767329911a9b76996182156
16:50 crab bc547: how do you want to be credited in the commit message?
16:50 jnbek joined #mojo
16:50 * xantus humps crab
16:51 crab hi xantus
16:54 crab ok, no credit for you :-P
17:01 bc547 crab: oh.. I was called away for a moment
17:02 bc547 crab: I'll prepare the answer the next reported bug :-)
17:02 crab sure. i said "bug report by bc547", but i haven't pushed. if you want me to change it, i still can.
17:02 bc547 crab: hehe.. that's fine by me :-)
17:03 good_news_everyon joined #mojo
17:03 good_news_everyon [mojo] amenonsen pushed 1 new commit to master: http://git.io/pqtnxg
17:03 good_news_everyon mojo/master 7ddef73 Abhijit Menon-Sen: Make single-character header field names work again...
17:03 good_news_everyon left #mojo
17:03 crab that should fix it. could you please verify?
17:09 bc547 crab: yups.. it works now \o/
17:10 bc547 crab: tnx a lot! :-)
17:13 crab you're welcome.
17:13 meshl joined #mojo
17:20 xantus good news everyone!
17:21 xantus the paternity test results are in, and I'm not your father!
17:46 rawler joined #mojo
17:50 kyshtynbai joined #mojo
17:51 kyshtynbai Hi guys! I'm totaly new to frameworks. Could you please tell me what port does the Mojo's web server listen to? I cant' find it in documentation.
17:53 bc547 kyshtynbai: morbo (development server) listens by default on 3000,  hypnotoad (production server) on 8080
17:54 bc547 kyshtynbai: http://mojolicio.us/perldoc/Mojolicious/Guides/Cookbook#Morbo
17:54 kyshtynbai Thanks! And one more question, does Mojo work with HTML::Templates?
17:57 basiliscos joined #mojo
18:09 bc547 kyshtynbai: why would you want that? Mojo already provides a (imho very good) template system.
18:10 bc547 kyshtynbai: but if you want I think you'll have to write some glue logic ( http://mojolicio.us/perldoc/Mojolicious/Guides/Rendering#Adding_your_favorite_template_system )
18:12 xantus kyshtynbai:  Mojolicious::Plugin::HTMLTemplateRenderer
18:14 xantus http://search.cpan.org/~bfaist/Mojolicious-Plugin-HTMLTemplateRenderer-0.04/lib/Mojolicious/Plugin/HTMLTemplateRenderer.pm
18:15 kyshtynbai Thanks!
18:17 good_news_everyon joined #mojo
18:17 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/1YLapg
18:17 good_news_everyon mojo/master b08adae Sebastian Riedel: formatting tweaks
18:17 good_news_everyon left #mojo
18:17 sri crab++
18:17 kyshtynbai Guys, where does Mojo stores uploaded files? I've uploaded a zip archive (and changed max_message_size) but even find / -name 'a.zip' finds nothing.
18:19 sri google says "single character" does not have a dash
18:19 jberger DASH-ALL-THE-THINGS!
18:20 sri \-o-/
18:23 kyshtynbai " all files above 250KB will be automatically streamed into a temporary file." -- and how this file is called and where do I find it :) ?
18:27 jberger kyshtynbai: right below that, in the example
18:27 sri kyshtynbai: please don't cross post your questions
18:27 sri that's considered very rude
18:28 kyshtynbai sri: ok, sorry.
18:30 jberger kyshtynbai: the documentation seems quite clear to me, what is confusing?
18:30 kyshtynbai jberger: hmmm. I literally cant see where the uploaded file is stored 0_o.
18:30 kyshtynbai http://mojolicio.us/perldoc/Mojolicious/Lite are we talking about this?
18:31 jberger http://mojolicio.us/perldoc/Mojolicious/Lite#File_uploads
18:31 jberger "All files uploaded via multipart/form-data request are automatically available as Mojo::Upload objects"
18:32 kyshtynbai Does this mean I have to write in on disk myself?
18:32 kyshtynbai *it
18:33 jberger the asset is in some temporary storage, either memory or temporary file, depending on size, until you "move_to" a location that you prefer
18:33 kyshtynbai Thanks! Now I get it.
18:34 Zx3 joined #mojo
18:34 jberger cool
18:37 * sri might be addicted to reese's peanut butter cups :o
18:38 * jberger prepares the intervention
18:38 kyshtynbai That worked. Thanks again.
18:38 jberger \o/
18:42 cpan_mojo Business-Payment-SwissESR 0.1.1 by Tobias Oetiker - http://metacpan.org/release/OETIKER/Business-Payment-SwissESR-0.1.1 (depends on Mojolicious)
19:39 xantus if you don't move it, it gets cleaned up when the tmp file handle goes out of scope
19:42 xantus I'm using a modified minion worker, it connects to the main app via /minion and reports the completed jobs
19:42 xantus minion++
19:42 xantus via /minion (websocket)
19:45 * jberger writes his first Arduino script! http://pastie.org/9271503
20:02 kyshtynbai Where should I specify path to a css file? I've tried to set in __DATA__ section, in <link> tag, but it seems id doesn't work.
20:10 jberger kyshtynbai: http://mojolicio.us/perldoc/Mojolicious/Lite#Static_files
20:12 denis_boyun joined #mojo
20:12 jberger kyshtynbai: just a reminder, the Mojolicious::Lite documentation serves as the tutorial for Mojolicious, all users are encouraged to read it and then the Guides in the order seen here: http://mojolicio.us/perldoc#GUIDES
20:21 kyshtynbai Thank!
20:21 kyshtynbai Thanks.
20:25 btyler joined #mojo
20:43 Adura joined #mojo
20:44 onefriedrice joined #mojo
20:47 ccm joined #mojo
20:48 rem_lex joined #mojo
21:00 kyshtynbai Guys, is it correct: this call "my $session = Mojolicious::Sessions->new;" checks if there's a session cookie stored in browser, and it there is, loads the session, otherwise starts new session?
21:04 jberger kyshtynbai: what does the lite tutorial tell you?
21:06 kyshtynbai actually, not much))) or I too... unprepared for using framewoks.
21:06 kyshtynbai *I'm.
21:06 jberger there is a "Sessions" heading, it gives a very clear example
21:07 kyshtynbai Well, I see it, but there's no NEW call. Is it okay?
21:08 kyshtynbai That's just seems a bit weird for me,at least for now...
21:08 jberger you rarely have to instantiate any new classes in Mojolicious
21:09 kyshtynbai I see.
21:09 jberger the session object and most others are built when the request is received and passed to the controller
21:10 jberger the examples in the lite documentation all run as-is (as far as I'm aware), so that should help you as you move forward
21:10 jberger everything is optimized for ease-of-use, perhaps you aren't expecting this to be this easy :-)
21:12 kyshtynbai Well, I'll try to say it in other words. Lets say I want the following: if a session is loaded and has _can_access_ parametr set to 1, than render a page which is otherwise hidden. I can do it with CGI buy instantiation of CGI::Session and cheking this can_access parameter. And I'm to figure out how to do it in Mojo).
21:13 stephan48 you can access the session via $c->session('key') and set it via  $c->session('key' =>
21:13 stephan48 you can access the session via $c->session('key') and set it via  $c->session('key' => 'value');
21:14 kyshtynbai I see! Thanks!
21:14 jberger kyshtynbai: if you had clicked through the links in that Lite section, you would have seen that
21:14 sri it's kinda funny when people have trouble learning mojolicious because things are too easy
21:15 jberger sri++
21:16 jberger stephan48/kyshtynbai: there is direct hash access too: $c->session->{key} = 'value'
21:16 kyshtynbai sri: the fact is - I started learning web programming with Perl via CGI module (and sub-modules). But everyone on freenode's #perl recommended me no to use CGI), but to use frameworks.
21:16 jberger kyshtynbai: yeah, CGI.pm is old news :-)
21:16 kyshtynbai :).
21:24 jberger unfortunately, the vocal champion of "CGI.pm must die!" is a fan of another framework, but the talk is still fun to watch
21:39 kyshtynbai Oh! It shows debug info! That's very cool.
21:49 good_news_everyon joined #mojo
21:49 good_news_everyon [mojo] kraih tagged v5.05 at 28c3a9b: http://git.io/Pkbr9g
21:49 good_news_everyon left #mojo
21:49 asarch joined #mojo
21:50 good_news_everyon joined #mojo
21:50 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/74D-xg
21:50 good_news_everyon mojo/master b8c2dde Sebastian Riedel: bump version
21:50 good_news_everyon left #mojo
21:51 cpan_mojo Mojolicious 5.05 by Sebastian Riedel - http://metacpan.org/release/SRI/Mojolicious-5.05
22:15 punter joined #mojo
22:20 mire joined #mojo
22:26 basic6 joined #mojo
22:43 d4rkie joined #mojo
23:03 d4rkie joined #mojo
23:11 hummeleBop joined #mojo
23:49 neyasov_____ joined #mojo
23:50 kyshtynbai Guys,I'm not actuallu sure what search request should I send to google: let's say I have a template, which is static and only the contnents of <div id="content">CONTENT</div> should change depending on a link user presses ("contacts", "images" and like). Should I make a separate template for each route (/contact, /images ans so on) or it is possible to insert a portion oh tags into one main template? Hope I
23:50 kyshtynbai am understandable :) .
23:55 sri once again, that's in the tutorial

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