akaiiro has quit [Remote host closed the connection]
wontruefree has joined #crystal-lang
jokke has quit [Ping timeout: 268 seconds]
jokke has joined #crystal-lang
fifr has quit [Ping timeout: 248 seconds]
fifr has joined #crystal-lang
wontruefree has quit [Quit: bye]
alex`` has joined #crystal-lang
<FromGitter>
<rishavs> Hi folks. is there a jwt creation/consumption module bundled with Crystal? Or should I use `crystal-community/jwt?`
<FromGitter>
<bendietze_twitter> @straight-shoota thank you very much :) can you ping me here? I found no way on gitter android chrome to start chat and using the App on my phone is very laggy - even all of them don't upgrade the other one - a chat on my phone isn't viewable on laptop and so on. Gitter android app is hanging all the time, so i better stay with browser on mobile ;) i would like to talk to you (in german :P) š
<crystal-gh>
[crystal] sdogruyol closed pull request #5623: Implement File and Dir for win32 (master...feature/windows-file-dir) https://git.io/vN2Ua
<FromGitter>
<bararchy> Boom! File\Folder for Windows merged
<FromGitter>
<sdogruyol> @straight-shoota nope. it's fine
Raimondi has quit [Ping timeout: 264 seconds]
Raimondii is now known as Raimondi
<FromGitter>
<bararchy> @straight-shoota I think it was reviewed by @bcardiff, @sdogruyol and @ysbaddaden , which means it's 1+ minimal need to review and merge
<FromGitter>
<bararchy> btw is #6333 ready for review after RX14 latests requests?
<FromGitter>
<straight-shoota> I interpreted RX14's request for final reviews as a call to all who had previously reviewed it to take another look at it. And at least @bcardiff was obviously under the impression it wouldn't be merged soon (before Path type). But, I'm fine with it. Things can be changed later, anyway.
<FromGitter>
<bcardiff> It was fine. I was 99% ready to merge (and I think that was clear in the PR). The missing 1% i double check it after merge, and š .
<FromGitter>
<straight-shoota> All right. I was just surprised :D
<FromGitter>
<straight-shoota> But it's great to see this merged š
<FromGitter>
<bararchy> Lets get `ENV` merged and we are in a great speed for Windows support :)
<FromGitter>
<straight-shoota> `ENV` isn't that important, actually. Reading an environment variable was already implemented. It just adds reading all and setting which isn't used too much. But it was fairly easy to do. And will get us towards running the spec suite.
<FromGitter>
<j8r> Yes i think, don't see any TIOCGWINSZ
<FromGitter>
<rishavs> Hi. I have a generic question about sending authorization headers from my webpage. Currently I store the jwt that the server generated, on the client in localstorage. On every page request, i can use JS to add the auth headers to my http request. But I was wondering if it is the normal way of sending them. Is there a native implementation in HTML itself which is recommended for this? Perhaps the html>head>meta>
<FromGitter>
... tags are used for this?
<FromGitter>
<bararchy> Will `WebSocket.send` send the message before `run` is called?
lvmbdv has quit [Quit: Leaving.]
<FromGitter>
<j8r> nvm for my question, I've just generated the bindings of `/usr/include/asm-generic/ioctls.h` with crystal-autobind
<FromGitter>
<bararchy> cool :)
<FromGitter>
<bararchy> I use crystal_lib for generating bindings
<FromGitter>
<bararchy> What do you guys feel about adding timeout option for a websocket socket
<FromGitter>
<bararchy> ?
<FromGitter>
<sdogruyol> meh...
<FromGitter>
<sdogruyol> I don't feel like it belongs to std
<FromGitter>
<bararchy> WebSockets in general?
<FromGitter>
<sdogruyol> timeout and keep-alive for websocket deserves a shard
<FromGitter>
<straight-shoota> @Grabli66 there is already an issue for that
<FromGitter>
<Grabli66> Good
<FromGitter>
<rishavs> How would I set a cookie in my response? doing `context.response.cookies["Set-Cookie"] = HTTP::Cookie.new("foo", "bar", "/admin", Time.now + 12.hours, secure: true)` throws overload errors.
<FromGitter>
<rishavs> Doing this works `context.response.headers["Set-Cookie"] = "foo=bar; HttpOnly"` but `context.response.headers["Set-Cookie"] = HTTP::Cookie.new("foo", "bar", "/admin", Time.now + 12.hours, secure: true)` fails. o.0
<FromGitter>
<Blacksmoke16> are trying to set a cookie object to a header try calling `to_set_cookie_header` on it
<FromGitter>
<Blacksmoke16> which will build the cookie string based on values in the Cookie obj
<FromGitter>
<bararchy> @veelenga are you dropping ameba?
<crystal-gh>
[crystal] laginha87 opened pull request #6336: Improve docs of big module overloads (master...laginha87-improve-big-docs) https://git.io/fbhC8
<FromGitter>
<rishavs> @Blacksmoke16 thanks. will try out as soon as I start my pc
<FromGitter>
<Blacksmoke16> š
<FromGitter>
<Blacksmoke16> @rishavs browser would send it along if you stored it in a cookie. But for localstorage, depending on what framework (if any) there are options
<FromGitter>
<rishavs> @Blacksmoke16 I think there is a bug in cookie.new
<FromGitter>
<Blacksmoke16> oh?
<FromGitter>
<rishavs> `context.response.headers["Set-Cookie"] = HTTP::Cookie.new("foo", "bar", "/admin", Time.now + 12.hours, secure: true).to_set_cookie_header` does sets a response cookie called Set-Cookie. but the cookie is not actually saved in the browser. I am assuming its because the cookie format is throwing some browser exception. ā ā However using simply `context.response.headers["Set-Cookie"] = "ding=dong"` sets a
<FromGitter>
... response header and then the cookie is also set in the browser
<FromGitter>
<Blacksmoke16> could be setting the cookie on a diff domain
<FromGitter>
<rishavs> Or maybe the the doc where I took the example of `HTTP::Cookie.new("foo", "bar", "/admin", Time.now + 12.hours, secure: true)` is outdated
<FromGitter>
<Blacksmoke16> what if you just did `HTTP::Cookie.new("foo", "bar")`
<FromGitter>
<rishavs> This is the problem bit `secure: true`
<FromGitter>
<rishavs> this works ` context.response.headers["Set-Cookie"] = HTTP::Cookie.new("foo", "bar", "/admin", Time.now + 12.hours).to_set_cookie_header`
<FromGitter>
<Blacksmoke16> oh really
<FromGitter>
<Blacksmoke16> oh
<FromGitter>
<Blacksmoke16> doesnt get set because you arent on https prob
<FromGitter>
<rishavs> yep
<FromGitter>
<rishavs> :D
<FromGitter>
<Blacksmoke16> not really a bug then :p
<FromGitter>
<rishavs> Thanks for all the help. Not a bug but I did learn a lot. š
<FromGitter>
<Blacksmoke16> np
moei has quit [Read error: Connection reset by peer]
moei has joined #crystal-lang
duane has joined #crystal-lang
_whitelogger has joined #crystal-lang
<FromGitter>
<talbergs> @valamorgon yes global variables are not supported (I assume $var is older syntax, and @@ is for class properties) ā ā @valamorgon You did help me, the while loop now, when created with default output `output: :pipe` did exit as expected, Hooray. ā ā > you could save the proc variable somewhere ... [https://gitter.im/crystal-lang/crystal?at=5b3e386e60c38707836056e0]
<crystal-gh>
[crystal] bcardiff opened pull request #6337: Update bountysource link (master...docs/readme-bs) https://git.io/fbhVA
<FromGitter>
<veelenga> > @veelenga are you dropping ameba? ā @bararchy no, why do you think so?
<FromGitter>
<bararchy> @veelenga Because of: Thanks, everyone for the collaboration. I don't plan to continue working on it.
<FromGitter>
<bararchy> but now I guess you just meant the actual issue
<FromGitter>
<bararchy> lol
<FromGitter>
<bararchy> nvm
<FromGitter>
<veelenga> yes, the actual issue. Seems like the team is not really interested in getting it done, so i just closed it.
<crystal-gh>
[crystal] sdogruyol pushed 1 new commit to master: https://git.io/fbhr7
<crystal-gh>
crystal/master f446e1b Brian J. Cardiff: Update bountysource link (#6337)
<awgepragnoerg>
Hi! I am banging my head because of this compilation error: `type must be NoReturn, not String`. `String` apparently is not important, `NoReturn` is. I am guessing that Crystal believes the code will always throw? It won't but how do I find out the problem?
<awgepragnoerg>
Also, it is not easy to get a smaller reproducible case...
kosmonaut has quit [Remote host closed the connection]
kosmonaut has joined #crystal-lang
<oprypin>
get any reproducible case. as long as it's one file
<oprypin>
worst case, just put any relevant code snippet
<awgepragnoerg>
Sorry, I'll have to come back about this tomorrow...
awgepragnoerg has quit [Quit: Page closed]
cozachk has joined #crystal-lang
zachk has quit [Ping timeout: 245 seconds]
<FromGitter>
<adamgotterer_twitter> Can someone explain what's happening to "Server::Context" is in this statement: "def initialize(&@proc : WebSocket, Server::Context ->)". it doesn't appear to be used or assigned?
<oprypin>
where is that code
<FromGitter>
<bew> You have a captured block, saved into `@proc`, that takes 2 args (Websocket and Server::Context), and returns nothing
<oprypin>
later you have ` @proc.call(ws_session, context)`
<FromGitter>
<Blacksmoke16> awgepragnoerg do you have a code example?
TCZ has quit [Quit: Leaving]
duane has joined #crystal-lang
wontruefree has quit [Quit: bye]
RabbitWolf has joined #crystal-lang
<FromGitter>
<talbergs> continung the story. I wanted to pass the block outside module methods: ā ā ```code paste, see link``` ā ā but an error on last line, how this would be done? again tried like `Aaa.screen &Aaa.prox` and `Aaa.screen <-Aaa.prox`, but no luck. [https://gitter.im/crystal-lang/crystal?at=5b3e89c733b0282df403a18d]
<FromGitter>
<talbergs> followup question how typehint may be applied on blocks? `screen do |p : Process|` not the correct syntax
<oprypin>
can't
<oprypin>
about the previous thing: `Aaa.prox` is `Aaa.prox()`
<oprypin>
`Aaa.screen(&->Aaa.prox(Process))`
<oprypin>
`Aaa.screen { |p| Aaa.prox(p) }`
<oprypin>
are your options
<FromGitter>
<talbergs> Yes, this works. Thank you. I see I, gotta walk the docs one more time, I begin to feel uncomfortable. Hope to cach on soon.
<FromGitter>
<talbergs> thou I do not come from ruby world, but php's.
DTZUZO has quit [Ping timeout: 264 seconds]
lvmbdv has quit [Ping timeout: 268 seconds]
<FromGitter>
<bendietze_twitter> @talbergs much stuff in Crystal - no worry :)