Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6-lwp-gsoc, 2014-06-11

| Channels | #perl6-lwp-gsoc index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
01:22 FROGGS_ joined #perl6-lwp-gsoc
07:01 FROGGS joined #perl6-lwp-gsoc
09:54 sergot Can we talk about {en,de}conding?
09:55 FROGGS sure
09:57 sergot FROGGS: we have some **conding modules in p6 already, don't we?
09:57 sergot like: MIME:Base64
09:59 FROGGS yes
09:59 sergot I think, that we dont need all encoding/decoding now.
09:59 FROGGS correct
09:59 FROGGS because you actually only get responses in encoding you specify in the request, right?
09:59 sergot Which are more needed than others?
10:00 FROGGS gz might be useful
10:00 sergot FROGGS: I guess so
10:00 FROGGS but I don't think we really need any now
10:00 sergot hmm
10:00 FROGGS except http/1.1 says that some encodings must be supported
10:03 sergot So, Does handling cookies have higher priority for now?
10:08 FROGGS I'm not sure....
10:08 sergot As a summary, I can say that I have enough time left, my work goes as planned. What do you think FROGGS moritz [Coke]?
10:08 FROGGS can't you just make like five examples of GET requests, and see if they work out, and fix/implement stuff if not?
10:08 sergot I can, good idea.
10:09 FROGGS after that I'd try to log into a site that requires a cookie, and fetch some stuff
10:10 FROGGS but that should be done *after* the easy requests do work
10:10 sergot I like this plan.
10:47 moritz +1
11:01 dalek http-response: 49c1cb0 | sergot++ | lib/HTTP/Response.pm6:
11:01 dalek http-response: parentheses removed
11:01 dalek http-response: review: https://github.com/sergot/http-response/commit/49c1cb002b
11:06 sergot moritz: FROGGS: what do you think, where cookies should be handled?
11:06 sergot In which module.
11:06 sergot should it be http::message?
11:11 FROGGS why not in http::cookies?
11:11 FROGGS and then http::message will use it
11:11 sergot Yes, I meant where should it be used.
11:12 moritz in HTTP::Client
11:13 moritz it's responsible for keeping cookies around, and using it when generating a request
11:13 sergot hmm
11:14 sergot Sounds reasonable.
11:47 FROGGS joined #perl6-lwp-gsoc
11:49 dalek http-message: 3007d51 | sergot++ | / (2 files):
11:49 dalek http-message: .parse() should be able to push-header, push-header added
11:49 dalek http-message: review: https://github.com/sergot/http-message/commit/3007d51b30
11:56 sergot yea.. we probably need headers to be an array, not  a hash, to store more than one set-cookie header.
11:58 sergot or, do you have another idea? :)
12:06 moritz array sounds fine
12:06 sergot What about one looking like this:
12:06 moritz there are also a few (very few) applications when you're interested in the order of the headers
12:06 moritz (like when you want to finger-print different HTTP servers)
12:06 sergot ( { name => (value1, value2) }, { ... }, ... ) ?
12:07 sergot looks*
12:07 moritz how does the p5 module do it?
12:14 sergot At the first glance it uses a hash, but keeps headers order in an array
12:15 sergot s/keeps/stores/
12:15 sergot https://github.com/perl6/mu/blob/master/ext/libwww-perl/lib/HTTP/Headers.pm
12:16 FROGGS and the values of the hash are arrayrefs?
12:17 FROGGS so that you can have multiple values per header name?
12:17 FROGGS because that is what you did IIRC
12:18 sergot I did this, and it looks like the p5 module works the same
12:24 sergot FROGGS: but getting using headers('') returns values joined with ',', so I'll look like this: Set-Cookie: n1=v1; Expires = Wed, test; secure, n2=v2; Expires = Wed, test; secure
12:24 sergot yea, ok, we'll see, give me some time :)
12:25 FROGGS :o)
12:27 sergot I have a question.
12:27 moritz only one?
12:27 moritz :-)
12:27 sergot :)
12:28 sergot What I do in this case is: $response.headers.headers<Set-Cookie>. and it's ... ugly
12:28 sergot I want to simplify this
12:28 moritz well, $response.headers probably should have an 'add' method
12:28 sergot What should I do, to provide such solution: $response.headers<>
12:29 moritz so it would be  $response.headers.add('Set-Cookie', '...')
12:29 moritz which IMHO isn't ugly anymore
12:29 sergot it has $response.header(Set-Cookie => 'blabla');
12:30 sergot hmm
12:30 sergot i can do something with HTTP::Headers.header...
12:30 sergot it shouldn't return a Str
12:30 sergot https://github.com/sergot/http-headers/blob/master/lib/HTTP/Headers.pm6#L19
12:37 sergot hmmm
12:42 sergot Can I do something with but role { method Str }  ?
12:42 sergot I mean
12:43 sergot add to returning value a role with method STr that joins elements with ', ' ?
12:43 sergot "%.headers{$header} but role { method Str { return self <--- return joined elemes here } }"
12:43 sergot %.headers{$header} but role { method Str { return self.join(', ') } } if %.headers{$header};
12:44 sergot moritz: what do you think about this solution?
12:46 moritz I think it sucks.
12:46 sergot :(
12:46 moritz mixing in roles is usually a bit hacky
12:46 moritz what about having a Header class, which has a key and an array of values?
12:47 moritz and does this kind of stringification?
12:47 sergot I thought about this, but this will bring a lot of more changes in every HTTP::* module
12:48 sergot But it's the best way to do this I guess
12:48 moritz note that HTTP::Headers can create those things implicitly for you
12:50 sergot I'll give it a try.
12:52 FROGGS joined #perl6-lwp-gsoc
12:54 sergot FROGGS: some decisions were made, see logs
13:09 * FROGGS looks
13:10 FROGGS +1 to HTTP::Header
13:19 sergot almost done
13:19 sergot :)
13:51 dalek http-headers: d90ca03 | sergot++ | / (3 files):
13:51 dalek http-headers: %.headers changed to @.headers, we have an array of HTTP::Header now
13:51 dalek http-headers: review: https://github.com/sergot/http-headers/commit/d90ca0393e
13:54 sergot \o/
13:54 moritz \o/
13:55 sergot Yeah, it brokes some HTTP::Message tests
14:06 FROGGS still nice :o)
14:06 FROGGS sergot++
14:17 dalek http-headers: 884d48f | sergot++ | lib/HTTP/Headers.pm6:
14:17 dalek http-headers: .header() fix
14:17 dalek http-headers:
14:17 dalek http-headers: it should overwrite a header if exists, add new one otherwise.
14:17 dalek http-headers: review: https://github.com/sergot/http-headers/commit/884d48f266
14:17 sergot this should fix some tests
14:18 sergot yay \o/ HTTP::Message works
14:19 FROGGS yay!
14:19 [Coke] woot
14:19 sergot almost.. :P
14:19 FROGGS hehe
14:20 dalek http-message: ce724c4 | sergot++ | / (2 files):
14:20 dalek http-message: HTTP::Headers changed
14:20 dalek http-message: review: https://github.com/sergot/http-message/commit/ce724c41e7
14:20 sergot Now! :)
14:20 sergot Result: PASS
14:21 sergot Request and Response work too!
14:23 sergot Could somebody help me with DateTime::Parse's tests?
14:23 sergot ==> Testing DateTime::Parse
14:23 sergot t/01-basic.t .. ===SORRY!===
14:23 sergot Could not find symbol '&Grammar'
14:26 dalek http-useragent: 138b905 | sergot++ | lib/HTTP/UserAgent.pm6:
14:26 dalek http-useragent: my stupid mistake, masak++
14:26 dalek http-useragent: review: https://github.com/sergot/http-useragent/commit/138b90527f
14:28 FROGGS sergot: I will
14:28 sergot FROGGS++: thanks!
14:28 FROGGS that was a precomp bug, right?
14:29 dalek http-useragent: f5dc7a2 | sergot++ | lib/HTTP/UserAgent.pm6:
14:29 dalek http-useragent: HTTP::Headers has changed
14:29 dalek http-useragent: review: https://github.com/sergot/http-useragent/commit/f5dc7a2ec1
14:29 FROGGS yes it is :/
14:29 sergot FROGGS: yes
14:29 sergot I guess
14:48 dalek datetime-parse: af161e6 | (Tobias Leich)++ | / (4 files):
14:48 dalek datetime-parse: work around precomp bug
14:48 dalek datetime-parse:
14:48 dalek datetime-parse: We have to put the grammar and actions inside the DateTime::Parse class right
14:48 dalek datetime-parse: before declaring the new method. Otherwise it complains about missing symbol
14:48 dalek datetime-parse: &Grammar when the modules are precompiled.
14:48 dalek datetime-parse: review: https://github.com/sergot/datetime-parse/commit/af161e658a
14:48 FROGGS I think this is due to the fact that we are messing with the DateTime:: namespace that comes from the setting
14:49 sergot hm, weird
14:49 sergot I dont like it, hehe :)
14:50 dalek http-cookies: fae6d80 | sergot++ | t/01-basic.t:
14:50 dalek http-cookies: plan added
14:50 dalek http-cookies: review: https://github.com/sergot/http-cookies/commit/fae6d80dca
17:06 FROGGS joined #perl6-lwp-gsoc
20:39 sergot joined #perl6-lwp-gsoc

| Channels | #perl6-lwp-gsoc index | Today | | Search | Google Search | Plain-Text | summary