<asterite>
RX14: we should probably split HTTP::Request in two, yeah... I also thought about that recently. The server request would have an IO from which you can read, and for the client we could probably have a post_io or similar that would give you an IO that you can write to, and eventually execute the request (optionally providing a block to read the response as an IO)
<RX14>
yup
<RX14>
i would make an issue but it's 1am
bjz has joined #crystal-lang
pawnbox has quit [Ping timeout: 244 seconds]
bjz has quit [Client Quit]
nakilon has quit [Quit: WHY NOT?]
soveran has joined #crystal-lang
Oliphaunte has joined #crystal-lang
Oliphaunte has quit [Ping timeout: 240 seconds]
pawnbox has joined #crystal-lang
soveran has quit [Remote host closed the connection]
pawnbox has quit [Ping timeout: 252 seconds]
willl has joined #crystal-lang
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 265 seconds]
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 276 seconds]
ponga has quit []
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 244 seconds]
onethirtyfive has joined #crystal-lang
Oliphaunte has joined #crystal-lang
Oliphaunte has quit [Ping timeout: 276 seconds]
matp has joined #crystal-lang
ome has joined #crystal-lang
Oliphaunte has joined #crystal-lang
Philpax has joined #crystal-lang
pawnbox has joined #crystal-lang
Oliphaunte has quit [Remote host closed the connection]
pawnbox has quit [Ping timeout: 260 seconds]
kulelu88 has joined #crystal-lang
snsei has quit [Remote host closed the connection]
Oliphaunte has joined #crystal-lang
Oliphaun_ has joined #crystal-lang
Oliphaunte has quit [Read error: Connection reset by peer]
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 250 seconds]
Oliphaun_ has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 244 seconds]
tomchapin has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
onethirtyfive has quit []
pawnbox has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
kulelu88 has quit [Quit: Leaving]
pawnbox has joined #crystal-lang
pawnbox_ has joined #crystal-lang
pawnbox has quit [Ping timeout: 260 seconds]
mark_66 has joined #crystal-lang
onethirtyfive has joined #crystal-lang
onethirtyfive has quit [Remote host closed the connection]
onethirtyfive has joined #crystal-lang
pawnbox has joined #crystal-lang
pawnbox_ has quit [Ping timeout: 276 seconds]
pawnbox has quit [Remote host closed the connection]
snsei has joined #crystal-lang
Philpax has quit [Ping timeout: 240 seconds]
snsei has quit [Ping timeout: 265 seconds]
pawnbox has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
pawnbox_ has joined #crystal-lang
pawnbox has quit [Ping timeout: 276 seconds]
bjz has joined #crystal-lang
pawnbox_ has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
willl has quit [Quit: Connection closed for inactivity]
pawnbox has quit [Ping timeout: 250 seconds]
pawnbox has joined #crystal-lang
Philpax has joined #crystal-lang
ponga has joined #crystal-lang
<FromGitter>
<sdogruyol> what does this mean? `@a : T*? = nil`
<FromGitter>
<sdogruyol> especially T*
<jhass>
T* is Pointer(T)
<FromGitter>
<sdogruyol> oh, now i see
<BlaXpirit>
sdogruyol, hm it's a bit strange to use `?` with a pointer, because you could use null instead
<FromGitter>
<kofno> OK... so rack looks in a few headers
<FromGitter>
<kofno> Web programming... smh... :)
<FromGitter>
<sdogruyol> haha
<RX14>
according to HTTP/1.1 the Host header is required
<RX14>
so it technically should be on every request
<FromGitter>
<sdogruyol> hmm
<RX14>
it can be empty though
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<jhass>
also if maybe not vetted support yet, we do have some conditionals to support HTTP/1.0 still
<FromGitter>
<sdogruyol> why
<jhass>
just saying, I didn't put them there
<FromGitter>
<kofno> well, host is required, but the request may be forwarded, in which case rack gives you the forwarded address instead of the proxy host. Apparently.
bjz has joined #crystal-lang
<FromGitter>
<sdogruyol> i think we can port this Rack impl to Crystal
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 264 seconds]
soveran has quit [Remote host closed the connection]
trapped has quit [Read error: Connection reset by peer]
pawnbox has quit [Remote host closed the connection]
mroth has quit [Read error: Connection reset by peer]
jwaldrip has quit [Read error: Connection reset by peer]
daemonwrangler has quit [Read error: Connection reset by peer]
ponga has quit [Read error: Connection reset by peer]
danzilio has quit [Read error: Connection reset by peer]
pawnbox has joined #crystal-lang
iamstef has quit [Read error: Connection reset by peer]
emmanueloga has quit [Read error: Connection reset by peer]
aemadrid has quit [Read error: Connection reset by peer]
danzilio has joined #crystal-lang
fedruantine has quit [Ping timeout: 260 seconds]
mroth has joined #crystal-lang
Oliphaunte has joined #crystal-lang
jwaldrip has joined #crystal-lang
daemonwrangler has joined #crystal-lang
<jeromegn>
how would I go about JSON.mapping something like {“a_key”: {“value”: “the value”}} to object.a_key == “the value”? I tried with JSON.mapping(a_key: {type: String, key: “a_key.value”}) but I get https://play.crystal-lang.org/#/r/1577
ponga has joined #crystal-lang
Philpax has quit [Ping timeout: 252 seconds]
<jeromegn>
I’ll probably have to write a macro if I want to parse that nicely eh?
fedruantine has joined #crystal-lang
iamstef has joined #crystal-lang
emmanueloga has joined #crystal-lang
matp has quit [Remote host closed the connection]
aemadrid has joined #crystal-lang
<jeromegn>
tempted to create a class that will forward missing stuff to its @value...
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
<BlaXpirit>
SF :p
rolha has joined #crystal-lang
<FromGitter>
<kofno> that's what I meant :p
snsei has joined #crystal-lang
mark_66 has quit [Remote host closed the connection]
snsei has quit [Ping timeout: 260 seconds]
ponga has joined #crystal-lang
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
<FromGitter>
<jwoertink> These links to the `play.crystal-lang.org` aren't working on firefox for OSX. Should I post an issue on the main repo? Or is there a separate repo for that?
<RX14>
it's carc.in repo you should be making an issue for
<jhass>
please tell more than "not working" though
<FromGitter>
<jwoertink> will do
snsei has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
snsei has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
Oliphaunte has quit [Remote host closed the connection]
<crystal-gh>
[crystal] sdogruyol opened pull request #3075: Add HTTP::Request#host and HTTP::Request#host_with_port for convenience (master...master) https://git.io/v6f05
rolha has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Raimondi has quit [Quit: WeeChat 1.6-dev]
rolha has joined #crystal-lang
Oliphaunte has joined #crystal-lang
triangles has joined #crystal-lang
Oliphaunte has quit [Ping timeout: 250 seconds]
Oliphaunte has joined #crystal-lang
Raimondi has joined #crystal-lang
kulelu88 has joined #crystal-lang
onethirtyfive has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 244 seconds]
pawnbox has quit [Remote host closed the connection]
<FromGitter>
<splattael> a dump question: How do I actually copy a string so it won't get modified using `Slice` methods? Currently I'm doing: `slice = String::Builder.new(string).to_s.to_slice`
<FromGitter>
<splattael> note, the code above has been ported from ruby (with all its consequences)
<FromGitter>
<splattael> `_shuffle` is "just" swapping some chars. no need to create new strings over and over again -> slice to the rescue :)
<FromGitter>
<splattael> jhass, the point, I do not want to modify the original string (`alphabet`) but it gets modified by using `Slice` because it's unsafe and therefore my probem, I know :-)
<FromGitter>
<splattael> yes, idiomatic Crystal is hard for me
<FromGitter>
<splattael> it's getting better though :)
<FromGitter>
<splattael> jhass, again thank you so much for your help <3
soveran has joined #crystal-lang
soveran has quit [Remote host closed the connection]
Oliphaunte has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Remote host closed the connection]
Oliphaunte has quit [Remote host closed the connection]
Oliphaunte has joined #crystal-lang
Oliphaunte has quit [Remote host closed the connection]
Oliphaunte has joined #crystal-lang
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
ponga has quit [Quit: Connection closed for inactivity]
<jeromegn>
what’s the idiomatic way of blocking a crystal program so that its spawned fibers can continue for as long as needed? right now I’m adding a very long sleep a the end of my program.
<RX14>
sleep with no argument
<RX14>
sleeps forever
<FromGitter>
<jwoertink> lol oops!
<FromGitter>
<jwoertink> hmm.. it does that in ruby too apparently
<RX14>
it just calls Scheduler.reschedule
<RX14>
in crystal
<RX14>
which never returns
<RX14>
which is nice
<FromGitter>
<jwoertink> It's interesting what I've learned about ruby from using crystal