Camelia, the Perl 6 bug

IRC log for #mojo, 2011-08-24

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

All times shown according to UTC.

Time Nick Message
00:12 alnewkirk tempire, nettuts
00:13 alnewkirk tempire, i have some unused templates you might light
00:13 alnewkirk like*
00:14 tempire send 'em over
00:14 tempire or post screenshots
00:15 alnewkirk tempire, brought, never used http://themeforest.net/item/mo​dern-business-2-xhtmlcss/45696
00:16 tempire hmm
00:16 tempire too much content for mojocasts use
00:16 alnewkirk tempire, http://themeforest.net/item/promo-landin​g-page-for-digital-product-sales/157207
00:17 Akron joined #mojo
00:21 alnewkirk cewl how the mojolicious favicon fits any application
00:27 GabrielVieira joined #mojo
00:31 ispy_ joined #mojo
00:37 xaka joined #mojo
00:48 Foxcool joined #mojo
00:56 GitHub98 joined #mojo
00:56 GitHub98 [mojo] kraih pushed 1 new commit to master: http://git.io/p3ab6A
00:56 GitHub98 [mojo/master] better test case - Sebastian Riedel
00:56 GitHub98 left #mojo
01:09 Alias joined #mojo
01:22 ispy_ joined #mojo
01:25 d4rkie joined #mojo
02:48 perlrocks Twitter: "Such obsolete or MOJO_RELOAD What's Mojolicious? Also look at the source ... come out ..." (ja) --Niratama http://twitter.com/Niratama​/status/106196237522448384
03:13 will joined #mojo
03:13 will left #mojo
04:03 GitHub158 joined #mojo
04:03 GitHub158 [mojo] kraih pushed 1 new commit to master: http://git.io/FPZ_Zg
04:03 GitHub158 [mojo/master] simplify Mojo::ByteStream - Sebastian Riedel
04:03 GitHub158 left #mojo
05:07 alpha6 joined #mojo
05:09 rhaen joined #mojo
05:09 rhaen moin
05:12 rhaen joined #mojo
05:13 rhaen Good morning, channel.
05:15 Alias_ joined #mojo
05:18 Foxcool joined #mojo
05:22 * sri waves
05:40 noganex_ joined #mojo
05:42 rbenea joined #mojo
05:45 rbenea left #mojo
05:46 sri oh shit
05:46 marcus oh?
05:46 sri summer glau was in the latest episode of alphas… now that show is toast
05:47 marcus :D
05:50 baton8 joined #mojo
05:58 rhaen sri: oh?
05:58 rhaen show? Futurama?
06:02 perlrocks Twitter: "Good morning everyone. Time to update your #mojolicious installation. #perl" --rabenfeder http://twitter.com/rabenfede​r/status/106244847177965568
06:21 koban` joined #mojo
06:22 plu joined #mojo
06:28 Firkin joined #mojo
06:44 Kulag joined #mojo
07:14 arthas joined #mojo
07:17 arpadszasz joined #mojo
07:21 Kulag joined #mojo
07:23 sugar joined #mojo
07:29 jamesw joined #mojo
07:33 Drossel joined #mojo
07:49 nickl joined #mojo
07:58 judofyr joined #mojo
08:06 cosmincx joined #mojo
08:10 spleenjack joined #mojo
08:25 Eugene joined #mojo
08:27 Kulag joined #mojo
08:38 Eugene joined #mojo
08:39 cosimo joined #mojo
08:39 Kulag joined #mojo
08:43 alpha6 joined #mojo
08:49 judofyr sri: how can you handle exceptions in callbacks properly?
09:01 Drossel joined #mojo
09:01 marcus sri: would you accept a patch to let MOJO_USERAGENT_DEBUG=1 print the url that it shows the response for at the first line? With parallel requests, it can be hard sometimes to know which response you're looking at.
09:05 judofyr marcus: +1
09:05 purl 1
09:10 Firkin left #mojo
09:15 jwang joined #mojo
09:35 Kulag joined #mojo
09:36 Firkin joined #mojo
09:43 Kulag joined #mojo
09:45 rhaen hep :)
09:45 rhaen guys, just something real simple :)
09:46 rhaen I've found Mojo::Asset - which is cool.
09:46 rhaen I've found Mojo::Upload, which is cool, too.
09:46 rhaen they provide a move_to method to write files.
09:46 Kulag joined #mojo
09:47 rhaen can I use them in an async function like ua->get(.., sub {....; $upload->move_to('myfile')});?
09:48 rhaen or is there a way to provide another callback to write in async mode and come back when it's done?
09:51 crab ->move_to does something useful only when you've got all the data in the asset
09:53 crab but what it does it just to (a) write out the file (for a memory asset), or (b) File::Copy::move the file (for a file asset)
09:53 crab i don't know what your concerns are in terms of async, but it should be generally safe to use ->move_to.
09:53 crab perhaps if you explained what you want in more detail, i could comment more specifically.
09:54 rhaen crab: good point :)
09:54 rhaen crab: I am using Mojo::UserAgent inside a lite app to fetch an image. I want to store that image and return it to the user.
09:55 rhaen the UA call is async so it returns when it finished getting it and returns it to the user.
09:56 rhaen so right now it would do the following: ua->get(.., sub {....; $upload->move_to('myfile')}); and the app is blocked until the move_to is finished.
09:57 rhaen (if I understand the async terms correctly)
09:57 rhaen I just wondered: if we have a async method to fetch things, is there an async way to store things.
09:57 crab no.
10:00 Kulag joined #mojo
10:08 Kulag joined #mojo
10:44 arpadszasz joined #mojo
10:54 Drossel joined #mojo
11:02 Kulag joined #mojo
11:22 sugar joined #mojo
11:42 cosmincx1 joined #mojo
11:51 sromanov joined #mojo
12:32 tabbi joined #mojo
12:32 tabbi left #mojo
12:35 elb0w Ok ruby or python as my secondary language
12:35 elb0w I cannot decide
12:40 Sjors joined #mojo
12:40 Sjors Hey
12:40 elb0w Ho! lets go!
12:40 Sjors I'm wondering: I'm reading http://mojolicio.us/perldoc/​Mojolicious/Lite#Conditions
12:41 Sjors I tried out adding a route for '/host' => (host => 'localhost') and one for '/host' => (host => '127.0.0.1')
12:41 Sjors but they never match, regardless of what Host header I give
12:41 Sjors this is Mojolicious 1.43; was this changed in later versions?
12:42 elb0w never used these
12:42 elb0w sri or someone probably can comment
12:42 elb0w but you should be keeping your mojo up to date
12:45 Sjors I'm going to update the packages today :-)
12:45 Sjors just wondering whether it was caused by that :)
12:46 elb0w seeing how mojo is at 1.89
12:46 elb0w and you are using 1.43
12:46 elb0w I would say its a very good chance
12:46 Sjors 1.43 wasn't too long ago
12:46 Sjors but yeah
12:46 elb0w Mojo is updated almost daily
12:46 Sjors hehe
12:46 elb0w from what ive seen
12:47 Sjors [format => ['foo']] doesn't really have the expected result (it allows all formats, regardless)
12:47 Sjors anyway, I'll try updating the packages, see if that helps anything
12:47 elb0w jk looks like mojo is at 2.18?
12:48 elb0w no 1.79
12:48 elb0w er
12:48 elb0w 89
12:48 Sjors 1.89 yeah
12:50 judofyr elb0w: if you go for Ruby, feel free ask me (or in #ruby-lang) if you need some help (I'm primary a rubyist) ;)
12:50 elb0w Is it a fun language to use?
12:50 elb0w or think its a niche
12:51 elb0w sorry not really a good way to compare what I mean
12:51 ispy_ joined #mojo
12:51 Sjors oh, hey, the new Mojolicious is com S/SR/SRI, not K/KR/KRAIH
12:51 Sjors sri: did you change usernames? :)
12:51 elb0w judofyr: I mean I always hear it not being mature yet is that true?
12:52 elb0w lmao
12:52 judofyr elb0w: well, it was a lot more fun a few years ago when it was less mature ;)
12:52 elb0w ah
12:52 elb0w Was reading about clojures in ruby last night
12:53 judofyr pretty much like closures in Perl, no? except that Ruby has a proper garbage collector?
12:54 elb0w never really use clojures
12:54 elb0w yeah but why would the garbage collector matter? Does the clojure keep a copy or force the vars to be in scope?
12:55 elb0w Does/Doesnt
12:56 judofyr (first of all: Clojure = another language, closure = capturing variables in anonymous functions/blocks)
12:56 elb0w oh
12:56 elb0w my bad
12:56 judofyr :)
12:56 elb0w haha closure
12:56 elb0w yeah I see clojure so much now
12:56 elb0w im mixing them up
12:57 judofyr it's not really an issues with closures, but with cycles. and it's pretty easy to create cycles when you use closures
12:57 Sjors judofyr: doesn't Perl have a proper garbage collector?
12:57 elb0w Yeah I need to play with them more
12:57 judofyr Sjors: it doesn't handle cycles
12:57 Sjors ah eww
12:57 Sjors that sucks
12:57 purl The rock is now off.
12:57 judofyr I know
12:57 Sjors are you sure about this? :/
12:58 judofyr yes
12:58 judofyr I had to use weaken() in my code to not introduce memory leaks: https://github.com/judofyr/parallol/blob/ma​ster/lib/Mojolicious/Plugin/Parallol.pm#L23
12:58 judofyr Perl uses reference couting
12:58 judofyr counting*
12:59 Sjors ah
12:59 judofyr with no cycles collector (Python has that)
13:00 Sjors that's silly
13:00 judofyr that's what I said too :)
13:00 Sjors Perl is older than Linux, you'd think they'd have added that by now
13:00 judofyr Perl 6 will have it though
13:00 judofyr although nobody actually uses Perl 6
13:00 Sjors yeah, hehe
13:00 judofyr Sjors: you're new to Perl?
13:01 Sjors judofyr: not at all, just never looked into the internals
13:01 judofyr interesting. I learnt it 3 weeks ago :P
13:01 Sjors judofyr: back when I learned Perl, my general computing science skills were a lot less complete than they are now
13:01 Sjors so I never bothered about things like circular references and my code from back then is usually horrible
13:05 Sjors hmm, it's a little bit lame that one needs to call $self->session() before calling $self->render_text()
13:07 perlrocks Twitter: "Helping out a #Perl beginner (PHP/JS/Java developer) run some #Mojolicious apps. Seems the docs are very beginner friendly. :D" --arpadszasz http://twitter.com/arpadszas​z/status/106351992590442496
13:10 Sjors elb0w: looks like updating to the newest version fixed some things, but not everything
13:11 Sjors elb0w: format checking is much better (read: working) now, and the problem that a session variable wasn't set was caused by me not reading the docs well enough, I guess
13:11 lammel hey folks
13:12 lammel does anybody know if morbo or hypnotoad will give the remote address of the request?
13:12 lammel I did not find it in the docs
13:12 lammel ah now I found it
13:13 lammel it should be in the transaction
13:13 Sjors elb0w: host checking, however, seems not to work yet :/
13:14 elb0w not sure
13:15 elb0w wait for sri to come around
13:16 lammel Well final deployment will be behind a reverse proxy anyway, so I also setup nginx locally and forward a "new base" url with scheme://host:port/path
13:16 lammel so I use this to rewrite the base url in a before_dispatch hook
13:16 lammel to answer with correct urls
13:17 lammel and for the remote address I use the X-Forwarded-For header and just use that instead of remote_address
13:19 Alias joined #mojo
13:28 SmokeMachine joined #mojo
13:35 Sjors elb0w: working now. I didn't completely restore my earlier tries to get it working on the older version
13:40 sri lammel: http://mojolicio.us/perldoc/Mo​jo/Transaction#remote_address
13:42 sri rhaen: move_to async? That would require soething like IO::AIO
13:43 sri anyway, like crab said, it doesn't make much sense, we have the whole file and it's usually just editing meta data (depending on file system of course)
13:47 Sjors joined #mojo
13:52 judofyr sri: is there a way of telling Mojolicious that "this callback is a part of the current request", so I get a pretty 500 page (with trace and linenumbers etc.) in the browser?
13:52 sri no, callbacks leave the safety net
13:53 sri let me know if you find a way to make it work ;)
13:53 d4rkie joined #mojo
13:54 SmokeMachine joined #mojo
13:57 elb0w yea
13:57 elb0w er
13:58 judofyr sri: the tricky thing with callbacks is that you can have exceptions in many of them…
13:59 sri in the mojolicious apis they are catched though, but go to the log
14:00 judofyr it would be pretty easy to add that to Parallol though
14:00 judofyr because Parallol generally combines the callback with the request
14:05 sri it should have it automatically
14:05 sri unless you're talking about the debug screen… which wouldn't be easy
14:08 anaio joined #mojo
14:12 sugar joined #mojo
14:16 marty Good morning everyone.
14:16 Alias left #mojo
14:19 * sri waves
14:23 alpha6 joined #mojo
14:25 kaare joined #mojo
14:51 abra joined #mojo
14:57 Sjors what's the recommended way to translate text in Mojolicious?
14:57 Sjors is there something like "localized templates"?
15:00 judofyr there's a I18N plugin
15:00 judofyr Sjors: https://metacpan.org/module​/Mojolicious::Plugin::I18N
15:00 koban` left #mojo
15:00 judofyr it's a part of Mojolicious
15:01 judofyr so no dependencies :)
15:03 amoore joined #mojo
15:12 Sjors oh awesome
15:12 Sjors damn, there's nothing sri forgot, eh?
15:12 * sri forgot lunch :o
15:18 * Sjors sends sri a copy of his lunch.pm
15:19 Sjors sri: there's a typo in the NAME of the pod of I18N.pm though
15:20 Sjors sri: it's tiny. "inte*r*nationalization"
15:20 Sjors just sayin' :)
15:20 judofyr or we can call it I17n
15:21 alpha6 joined #mojo
15:21 Sjors :-D
15:21 GitHub136 joined #mojo
15:21 GitHub136 [mojo] kraih pushed 1 new commit to master: http://git.io/ccfcVw
15:21 GitHub136 [mojo/master] fixed typo - Sebastian Riedel
15:21 GitHub136 left #mojo
15:22 sri ;p
15:23 judofyr "fixed typo". the best commit message.
15:23 judofyr I commit everything under "fixed typo"
15:25 elb0w Better then our popular one here
15:25 elb0w "N/A"
15:25 Sjors hehe
15:25 Sjors "fixed bug" actually works for every commit
15:25 elb0w or "minor"
15:26 Sjors missing features can be considered a (wishlist) bug
15:26 elb0w | | | | * | | | ebd69f5 - fixed typo (5 months ago) <George Tsafas>
15:26 elb0w lol
15:27 elb0w 4c5ec0d - asdasd (4 months ago)
15:27 elb0w informative
15:27 elb0w haha
15:27 xaka joined #mojo
15:28 elb0w personal favorite though has to be, d804e2d - Update (8 months ago)
15:33 Sjors hehe
15:33 Sjors "Committing"
15:37 elb0w "Made changes"
15:37 elb0w I cant convince my boss to use branches with git
15:37 elb0w makes me cry
15:43 Sjors you can always import his work into a branch of your own ;-)
15:44 sri really nice that you can now add a link to an amazon wishlist to your metacpan profile
15:45 elb0w thank god
15:45 purl amen to that
15:45 elb0w That the new way of saying thank you?
15:46 sri it could be
15:46 sri sidebar seems a little cluttered now though
15:46 Sjors are all of Mojo's and Mojolicious' dependencies in perl itself?
15:46 sri http://mojolicio.us/perldoc/Mojolicious/Guides/FAQ​#Why_doesn27t_Mojolicious_have_any_dependencies3F
15:49 perlrocks Twitter: "Mojolicious-Plugin-Toto 0.08 by BDUGGAN - http://t.co/DeH86RM" --cpan_new http://twitter.com/cpan_new​/status/106392599832690689
15:51 alpha6 joined #mojo
15:55 alpha6 joined #mojo
16:10 zakame $self->respond_to() is crack, just what I need :)
16:17 SmokeMachine joined #mojo
16:18 lammel2 joined #mojo
16:19 sri :)
16:31 metaperl joined #mojo
16:32 SmokeMachine joined #mojo
16:36 alnewkirk sri, when you have time can you look at https://github.com/alnewkirk​/Mojolicious-RestApp-Example and tell me why the tests fail with 500 status?
17:06 tempire alnewkirk: that's asking a lot.  break the problem down to a 5 line paste, and someone is more likely to look at it
17:07 tempire elb0w: why bother with ruby or python?  If you're going to learn something new, learn something different that will expand your mind
17:07 tempire a functional language will change your whole perspective on programming
17:07 elb0w like haskell?
17:07 tempire sure
17:07 elb0w started learning haskell
17:07 tempire or lisp, erlang
17:08 elb0w guess I should finish
17:08 tempire scheme
17:08 tempire whatever
17:08 elb0w maybe clojure
17:08 tempire a lisp will be the biggest learning curve
17:09 elb0w yeah
17:09 * tempire hugs marcus
17:09 elb0w nothing like diving in to something though
17:10 ispy_ joined #mojo
17:10 tempire just have to keep at it.
17:11 tempire I just spent several months on common lisp
17:11 elb0w thats my issue. All I ever do here is perl and ocassionally c++/python
17:11 tempire was worth it
17:13 Eugene joined #mojo
17:14 tempire it helps if you recreate something you've already done in your main language.
17:14 tempire exposes all the little things you might otherwise miss, and rounds out your understanding of the dialect
17:18 SmokeMachine joined #mojo
17:27 alnewkirk tempire, its not something that can be expressed in a 5 line paste
17:28 alnewkirk the app is already generated, all you have to do is run it through a debugger
17:29 alnewkirk the reason i asked sri is because i may be a bug, the app runs fine without error in the browser but dies in Test::Mojo env
17:32 stephen joined #mojo
17:36 sri elb0w: do you want to learn something useful or just something to expand your mind?
17:37 elb0w expand I guess
17:38 sri i guess haskell would be a rather good choice then
17:38 elb0w my system just failed a ubuntu upgrade
17:38 elb0w hardcore
17:38 purl I told u i was hardcore
17:38 sri python and ruby are very much like perl
17:39 elb0w ya
17:39 elb0w just feel like in 10 years there will be more jobs in python or ruby than perl
17:39 sri then you're looking for something useful ;p
17:39 tempire jobs are for suckers
17:40 sri java or .net prolly has the most jobs xD
17:40 elb0w almost became a C# programmer
17:40 elb0w glad I didnt
17:41 sri javascript is a safe bet these days
17:41 mspo true
17:41 elb0w I do js/jquery
17:41 mspo bloomberg is currently hiring ruby programmers like crazy here in nyc
17:41 mspo for pretty good money, I'm told
17:41 elb0w bb is pretty cool
17:42 elb0w deal with them everyday pretty much
17:42 elb0w Problem isnt getting the job
17:42 elb0w I know positions 90-200k for perl with c++
17:43 sri well, there's a huge difference between knowing a language and *really* knowing a language
17:43 sri i still learn something new about perl every other day
17:43 elb0w yeah
17:44 elb0w Part of me wants to learn another language, the other part doesnt know if I should wait till I am a perl guru
17:46 elb0w but that may take a couple years :P
17:46 zakame just keep learning something :)
17:46 zakame I know of people who stopped learning
17:46 elb0w Oh I do I read all day pretty much
17:46 elb0w yeah I cant do that
17:46 elb0w im on HN or /r/programming all day
17:46 elb0w or reading a ebook on something
17:47 zakame nice
17:47 xaka joined #mojo
17:47 elb0w I never went to school for any programming so I feel like its my only way to compete
17:47 elb0w dont even have a degree atm
17:47 tempire it's the only way to compete anyway.
17:48 tempire the only thing a degree is good for is the first course in cs basics
17:48 elb0w yeah just met some people in my life that have come out of schools like mit, georgia tech, rpi and they are really awesome
17:48 tempire learn: recursion, sorts, and know what big O is, and you're done.
17:48 elb0w yeah need to learn big O :P
17:48 tempire there's a clear line between business programmers and engineers.
17:49 elb0w Yeah sometimes I dont know how I got into this. I was never a good math/science student
17:49 tempire which is why I suggest learning a language for what it can teach you, instead of just knowing another language.
17:49 elb0w Yeah I always look at that
17:50 elb0w I read Learning Python before I even wanted to learn it
17:50 elb0w taught me a lot actually
17:50 elb0w was a very good book
17:50 tempire Take sri here.
17:50 mspo elb0w: experience is king
17:51 sri why me?
17:51 mspo I first read learning perl ten years ago and still suck :)
17:51 elb0w mspo: yeah I know, working for a firm on wall st though and not having a degree is like walking around with a big X
17:51 sri take tempire.
17:51 mspo elb0w: I'm in nyc too
17:51 elb0w ah cool
17:51 elb0w im on broad
17:51 elb0w right at the exchange
17:51 mspo elb0w: get a degree
17:52 elb0w yeah I know
17:52 mspo elb0w: I work on 35th
17:52 elb0w doing night school atm
17:52 elb0w yeah I wanted to work at midtown
17:52 Sjors hmm, why does this handler code:
17:52 mspo elb0w: live on 20th
17:52 tempire He never would have become http://bit.ly/jt0Hsn if he settled for being a programmer: http://bit.ly/lYa83w
17:52 Sjors $self->render_content(text => "foo bar baz");
17:52 Sjors $self->rendered;
17:52 Sjors give an empty 200 OK response, instead of a 200 OK response with "foo bar baz" contents?
17:52 elb0w was going to get hired at jeffries but my dad has a pretty powerful position there so they were worried id be treated unfairly and didnt give me it
17:52 elb0w sort of a bummer
17:52 mspo what is ->rendered?
17:52 elb0w mspo: ah I commute from jersey
17:52 sri Sjors: render_content is not what you think it is
17:52 Sjors mspo: http://mojolicio.us/perldoc/Mo​jolicious/Controller#rendered
17:53 mspo elb0w: apparently he's not powerful enough to get you a job ;)
17:53 tempire ack *business programmer
17:53 tempire delivery fail
17:53 zakame ack
17:54 mspo Sjors: how about that
17:54 purl hmmm... that is what I'm trying to figure out.  The session that is listening on the port.
17:54 elb0w well hes the global head of equity trading technology
17:54 Sjors sri: what should I use instead?
17:54 mspo Sjors: I have $self->render(text => "conf is: <pre>" . $conf->{base_dir} . "</pre>");
17:55 elb0w mspo: what do you do?
17:55 mspo elb0w: sysadmin
17:55 purl well, sysadmin is more stable. or http://www.gnu.org/fun/jok​es/know.your.sysadmin.html
17:55 elb0w nice
17:55 sri Sjors: the tutorial should have the answer
17:55 elb0w I do market data
17:55 zakame mspo++ # fellow sysadmin
17:57 mspo heh
17:58 elb0w mspo: you go to perl monger meetings?
17:58 mspo elb0w: never been to one.
17:59 elb0w they have meets in the city
17:59 elb0w I havent either
17:59 elb0w signed up thought, probably go it one of these days
18:16 elb0w well that was gay upgraded my machine
18:16 elb0w and it deleted everything
18:18 zakame ouch
18:27 Sjors mspo: but that is the complete rendering
18:27 Sjors mspo: I wanted to have a seperate "partial render", then render ending
18:27 Sjors sri: I guess I didn't see enough of them yet ;-)
18:28 Sjors sri: I was reading the Growing guide again, when I saw "201 Created" and suddenly started wondering what my browser would do if it got a 201 CREATED response
18:28 Sjors as a response to a regular GET
18:30 * sri thinks about chaning respond_to a little bit
18:30 sri *changing
18:31 mspo Sjors: can't you give partial => 1 or something?
18:35 Sjors mspo: hmm, that'd be a completely random experiment, but who knows
18:35 Sjors mspo: nope, alas
18:36 zakame for big O: http://www.perlmonks.org/?node_id=573138
18:37 mspo Sjors: I know there's a render partial in the docs somewhere
18:40 GitHub124 joined #mojo
18:40 GitHub124 [mojo] kraih pushed 1 new commit to master: http://git.io/dJBgLQ
18:40 GitHub124 [mojo/master] improved respond_to to automatically render an empty 204 response for unknown formats - Sebastian Riedel
18:40 GitHub124 left #mojo
18:40 sri i think that's more practical
18:40 sri at least it's what i would want for unknown formats most of the time
18:43 zakame yep that makes sense, I had a couple of those any => {text => '', status => 204} earlier
18:43 sri me too
18:45 Sjors what do you guys think is better as a response to any POST request that was fulfilled succesfully
18:45 Sjors (on a classic website)
18:46 Sjors a 2xx saying "Yep, it's done", or a 3xx to a GET page that says "Yep, it's done"?
18:46 mspo 200
18:46 sri omega: http://www.cpantesters.org/distro​/M/Mojolicious.html#Mojolicious-1.89 # looks like no_chdir is portable after all :)
18:47 sri Sjors: actually depends, 3xx if you want to prevent double submit
18:47 Sjors yeah
18:47 sri personally i like redirecting to the actual resource that was generated by the POST
18:48 sri then again i'm a sucker for everything RESTful
18:48 elb0w wow fmylife
18:48 Sjors when a browser gets a 3xx in response to a POST, does it GET the Location, or POST to it again?
18:48 sri don't be such a drama queen :)
18:49 mspo doesn't a 302 on a POST lose headers?
18:49 Sjors I just wondered started wondering
18:49 Sjors err
18:49 Sjors I just started wondering if browsers actually drop the POST request
18:49 sri a browser will never POST after a redirect
18:49 Sjors ahh
18:49 sri it's always an entirely new GET request
18:50 Sjors I read on Wikipedia that 303 is meant for "your POST was succesful, go GET this page"
18:50 sri no information will be leaked either
18:50 Sjors and browsers in practice implemented 302 to be the same as 303
18:50 Sjors 301 means that the page is completely removed and the request should be repeated against the Location, do browsers still use GET then?
18:50 Sjors i.e. any request in the future should also be against the new Location
18:50 sri mojolicious uses 302 exclusively
18:51 Sjors sri: oh, 307 is now meant for the behaviour I said earlier
18:51 mspo tell that to your SEO consultant :)
18:51 mspo 301's rank higher!
18:51 Sjors <http://en.wikipedia.org/wiki/List_o​f_HTTP_status_codes#3xx_Redirection>
18:52 sri we only do temporary in mojolicious
18:52 perlrocks Twitter: "Looking into Mojolicous::Plugin. NOW! #mojolicious" --rabenfeder http://twitter.com/rabenfede​r/status/106438648379092993
18:52 rhaen moin.
18:52 sri the good thing about 302 is that it just works
18:52 Sjors 302 and 303 means "your POST is succesful, now GET this page"
18:52 Sjors 307 means "you POSTed against the wrong page, POST against this one"
18:52 Sjors "in contrast to 303, the request method should not be changed"
18:53 Sjors I should check what Firefox, Safari, Opera and Chrome do in this case
18:53 sromanov joined #mojo
18:54 Sjors sri: is there a way to give a status code to Mojolicious::Controller->redirect_to() ?
18:54 Sjors or do I have to use rendered(307) ?
18:58 SmokeMachine joined #mojo
19:00 Eugene joined #mojo
19:02 perlrocks Twitter: "Mojolicious 1.90 by SRI - http://t.co/AK704DE" (ms) --cpan_new http://twitter.com/cpan_new​/status/106441318137470976
19:03 perlrocks Twitter: "Released #mojolicious 1.90 with a few small #rest improvements, enjoy! http://t.co/pB6CkQY #perl" --kraih http://twitter.com/kraih/status/106441634882924544
19:04 Firkin left #mojo
19:22 Eugene joined #mojo
19:24 Sjors sri: ok, I've tried it
19:24 Sjors sri: in most browsers, 302 and 307 work as described on Wikipedia
19:24 Sjors sri: Firefox and Opera actually say "hey, user, are you OK with me redirecting your POST contents?"
19:25 Sjors not completely user-friendly, as the standard describes the correct POST behaviour, and the user is unlikely to know better what the site wants
19:29 shonorio joined #mojo
19:34 alpha61 joined #mojo
19:39 ghandi joined #mojo
19:44 amoore joined #mojo
19:45 sugar joined #mojo
19:50 ispy_ joined #mojo
20:02 Shaeto joined #mojo
20:05 Shaeto fast question: mojo app behind reverse proxy, how to better provide app base url (visible for apache client) to make url_for working correctly in templates. for example now url_for('login') maps to /login instead of real /api/login, thanks!
20:16 Sjors sri: http://dazjorz.com/fwd/
20:16 Sjors sri: could you try it too? if you've got Twitter, RT http://twitter.com/#!/dazjor​z/status/106457239115673600
20:18 Sjors sri: I'm trying to get a complete coverage, so people can decide whether it works for them :)
20:23 Sjors or, anyone else, of course ^
20:30 Shaeto well, seems it is beter to modify routes and proxy url
20:55 arpadszasz joined #mojo
21:14 _[R] joined #mojo
21:15 * Sjors bbl
21:32 bosphorus joined #mojo
21:33 bosphorus joined #mojo
21:49 Kulag joined #mojo
21:53 SmokeMachine_ joined #mojo
22:02 Akron joined #mojo
22:49 arpadszasz joined #mojo
23:00 Shaeto left #mojo
23:21 arpadszasz_ joined #mojo
23:45 elb0w joined #mojo

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