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

IRC log for #mojo, 2015-05-22

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

All times shown according to UTC.

Time Nick Message
00:03 vmbrasseur joined #mojo
00:06 vmb joined #mojo
00:27 HtbaaPi joined #mojo
00:38 davido___ joined #mojo
01:17 jberger joined #mojo
01:34 bpmedley joined #mojo
01:45 jnbek joined #mojo
01:50 klapperl_ joined #mojo
02:17 jberger_ joined #mojo
02:26 jberger can I ask someone to do a strange favor for me? get banned from my server?
02:26 preaction how would i do that?
02:29 bpmedley It would be an honor and a pleasure.. ;)
02:30 jberger preaction got himself banned already, but if you want ;)
02:31 Grinnz preaction, well you could start out with some racist slurs and move up to spamming in broken english about hacking
02:32 Grinnz then, when you're ready, launch into a tirade of irrelevant conversation
02:34 preaction all conversation i launch is irrelevant!
02:34 Grinnz well you have to do it the right way, where each message is about something different but still insulting to most of the channel
02:53 noganex_ joined #mojo
03:14 inokenty-w joined #mojo
03:16 basic6_ joined #mojo
03:43 hshong joined #mojo
03:50 Oleg joined #mojo
04:01 jberger ok I think I'm happy with my irc setup again
04:01 jberger preaction++
04:03 vmbrasseur joined #mojo
04:15 vmb joined #mojo
04:35 kaare joined #mojo
04:36 polettix joined #mojo
04:57 mattastrophe joined #mojo
05:00 davido___ joined #mojo
05:06 polettix joined #mojo
05:09 davido__ joined #mojo
05:10 Oleg joined #mojo
05:38 dotandimet joined #mojo
05:56 dod joined #mojo
06:01 dod joined #mojo
06:28 Marlik joined #mojo
06:29 Marlik Hello, how to make ORM for Mojo use DBIx::Class? Thanks.
06:57 eseyman joined #mojo
06:59 absolut_todd joined #mojo
07:11 AndrewIsh joined #mojo
07:21 pete joined #mojo
07:22 pete I have an array of headers, eg:
07:22 pete [ ['X-foo' => 'bar'], ['Content-type': 'lolz'] ]
07:22 pete I could loop through, s/-/_/g; and do something like: $self->res->headers->$key
07:23 pete But is there a more direct way that doesn't involve me messing around with tr/-/_/
07:33 jb360 joined #mojo
07:33 trone joined #mojo
07:47 marcus marlik: just use normal perl to do it, and expose it with a helper or whatever
08:14 fhelmber_ joined #mojo
08:16 Vandal31341 joined #mojo
08:21 pete ah, there's a headers->add(
09:35 mattastrophe joined #mojo
09:44 polettix joined #mojo
11:07 neilhwatson joined #mojo
11:21 polettix joined #mojo
11:47 * batman is back
11:49 jberger batman: o/
11:49 batman not 100%, but i'm feeling a lot better :)
12:13 HtbaaPi I've run into a strange bug when calling a route from the commandline (script get /whatever) when using a non-blocking HTTP(S) call. For some reason $tx->res->body is empty
12:13 HtbaaPi when calling in either a blocking or non blocking way in a script (plain Mojo::UserAgent) the response body is being set
12:14 HtbaaPi when calling the url from the browser the response body is also being set. But when I call it through the command line it's empty and body_size is at 0, even though Content-Length header says it's not
12:21 HtbaaPi the non-blocking HTTP(s) call is of course being executed inside the controller
12:22 cpan_mojo joined #mojo
12:23 ZadYree joined #mojo
12:24 cpan_mojo joined #mojo
12:24 cpan_mojo Mojo-IRC-0.19 by JHTHORSEN https://metacpan.org/release/JHTHORSEN/Mojo-IRC-0.19
12:25 ZadYree hello there :)
12:25 HtbaaPi hello :)
12:27 ZadYree I've got a little question for you guys: I've got a frontend mojo service, and an interface that speaks with other equipment using plain http & websockets. I would like to switch the frontend board to HTTPS without touching the rest. Is it possible within hypnotoad or?
12:28 nicomen HtbaaPi: what server are you using?
12:28 HtbaaPi nicomen: this is on an Ubuntu 14.04 x64 server (Vagrant)
12:29 nicomen lolis your controller fetching urls from the same server it is running as?
12:30 HtbaaPi no, the HTTP request inside the controller is from another server
12:30 HtbaaPi *to another server
12:31 HtbaaPi but when running the application with Morbo it works just fine, but when using the commandline e.g. 'perl script/myapp get /something' it's not
12:31 nicomen ah
12:32 nicomen timeout?
12:32 purl timeout is probably NOT good
12:32 HtbaaPi the weird thing is, that in another controller action I do the samething but to another server and works just fine
12:32 HtbaaPi only difference is that the one it doesn't work is that it's going to a HTTPS server with a self signed certificate
12:33 HtbaaPi the headers I receive are fine, has custom headers sent by the other server as well as a content-size bigger than 0
12:33 HtbaaPi but the response message inside the object is simply empty
12:33 HtbaaPi this only happens when using that command line thing
12:34 HtbaaPi which I thought would be a quick way to see if my code works, instead I am in hours debugging something that works fine when using Morbo :P
12:40 ZadYree Well in fact I'd rather wonder how to check whether a client is using SSL/TLS... Any guesses?
12:44 HtbaaPi ZadYree: Hypnotoad can run as a SSL server https://metacpan.org/pod/Mojolicious::Guides::Cookbook#Hypnotoad
12:47 ZadYree but I want it to run both, and to redirect a browser from http to HTTPS
12:47 ZadYree services and browsers will use different controllers
12:48 ZadYree But on the browser side, I would like to check if SSL is used and redirect to the HTTPS version in case it is not.
12:48 HtbaaPi can't you just run 2 instances of Hypnotoad then, on different ports. One http and the other https
12:48 ZadYree That's exactly what I am planning to do
12:48 HtbaaPi not sure if you can do that with Hypnotoad. Are you exposing Hypnotoad to the world? In other worlds, is it not behind another server such a nginx
12:48 ZadYree But I don't want a user to type his credentials in a plain http context
12:49 ZadYree it will be behind a reverse proxy, yup
12:49 ZadYree but the rev prox will just be transparent
12:50 HtbaaPi inside your controllers or probably even better inside your router you can check the protocol used by the client
12:50 ZadYree ah, this is interesting :D
12:51 HtbaaPi inside a route or controller action you can call $self->req to get the request object
12:51 HtbaaPi https://metacpan.org/pod/Mojo::Message::Request#is_secure
12:51 AirDisa joined #mojo
12:51 HtbaaPi so $self->req->is_secure should tell you if your client is using SSL or not
12:52 ZadYree wow nice
12:53 HtbaaPi so I suppose you could write a router bridge (using under()) with a callback that you put in front of any route that should use HTTPS
12:53 HtbaaPi check if it's using HTTPS, if not redirect to the HTTPS url.
12:54 ZadYree Yup, that's exactly what I was thinking :)
12:54 HtbaaPi $self->req->url should give you the url. Change scheme with my $url = $self->req->url->scheme('https') and then redirect towards that url
13:07 ajr_ joined #mojo
13:09 zivester joined #mojo
13:19 ZadYree wow, that's better than my hack
13:27 craftsmanship joined #mojo
13:41 asarch joined #mojo
13:53 gryphon joined #mojo
13:53 rwp joined #mojo
14:15 jb360 joined #mojo
14:35 mattastrophe joined #mojo
14:49 fhelmber_ joined #mojo
14:50 zackiv31 joined #mojo
15:10 ajr_ joined #mojo
15:21 mattastrophe joined #mojo
15:32 ToApolytoXaos joined #mojo
15:38 ajr_ joined #mojo
16:05 kyshtynbai joined #mojo
16:09 amon joined #mojo
16:50 Oleg joined #mojo
16:51 disputin joined #mojo
16:54 Dandre1 joined #mojo
16:58 sh4 joined #mojo
17:04 mattastrophe joined #mojo
17:27 mattastrophe left #mojo
17:33 dod joined #mojo
17:44 ajr_ joined #mojo
17:52 polettix joined #mojo
17:56 trone joined #mojo
17:57 disputin joined #mojo
18:17 disputin joined #mojo
18:17 misty_g3ar joined #mojo
18:41 oetiker joined #mojo
18:47 polettix joined #mojo
19:15 berov joined #mojo
19:31 trone joined #mojo
20:10 dotandimet joined #mojo
20:38 Onigiri Oh man, a dinosaur puking a rainbow.
20:39 pink_mist it's effective in telling you something is wrong
20:39 trone joined #mojo
20:43 trone joined #mojo
21:37 marty anyone know an easy way to rename or copy the session cookie?
21:37 Grinnz_ to what end?
21:38 marty I want just want to copy the session cookie to a cookie with a different name.
21:38 marty wooo, bad english. sorry about that
21:40 Grinnz_ you can get the session cookie name from $c->sessions->cookie_name, and then find the cookie in https://metacpan.org/pod/Mojolicious::Controller#signed_cookie i believe
21:40 Grinnz_ well that is how to access its values
22:33 marty to easy.   my $val = $self->sessions->{id}; $self->sessions->cookie_name('new_name'); $self->sessions->{id} = $val;
22:34 bpmedley marty:  May I ask the rationale for doing that?
22:35 marty bpmedley: Just cleaning house.  We have some cookies with bad names.
22:36 bpmedley I see
22:37 * pink_mist humms https://www.youtube.com/watch?v=KrZHPOeOxQQ
22:38 bpmedley Gaw, how does bad music sound while humming?  :)
22:39 pink_mist since that's awesome music, I wouldn't know :P
22:39 bpmedley lol
22:45 absolut_todd joined #mojo
23:21 nicomen heh, Mojob, http://technoport.no/content/471/Tinder-for-Professionals

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