faustinoaq changed the topic of #amber to: Welcome to Amber Framework community! | https://amberframework.org | Developer happiness, productivity and bare metal performance | GH: https://github.com/amberframework | Docs: https://docs.amberframework.org | Gitter: https://gitter.im/amberframework/amber | IRC Logger: https://irclog.whitequark.org/amber | Amber::Server.start
alexherbo2 has joined #amber
alexherbo2_ has joined #amber
alexherbo2_ has quit [Ping timeout: 265 seconds]
alexherbo2 has quit [Ping timeout: 264 seconds]
alexherbo2 has joined #amber
alexherbo2_ has joined #amber
alexherbo2_ has quit [Ping timeout: 256 seconds]
alexherbo2 has quit [Ping timeout: 240 seconds]
alexherbo2 has joined #amber
alexherbo2_ has joined #amber
alexherbo2_ has quit [Quit: alexherbo2_]
alexherbo2_ has joined #amber
<FromGitter> <dyakubovich> Hello. I try to configure Amber::Pipe::CORS.new for cross-origin request. I added additional origins and extra header `X-Auth-Key`. On the frontend app i use `fetch` with options `credentials: 'include'`. It is working good, but if i add extra header `X-Auth-Key` to request, i will get 403 CORS error. Any idea how to send extra header with `credentials: 'include'` ? It's code example: ⏎ ⏎ ```code paste,
<FromGitter> <Blacksmoke16> looks like `GET` isnt in the valid method list by default? https://github.com/amberframework/amber/blob/master/src/amber/pipes/cors.cr#L22
<FromGitter> <Blacksmoke16> nvm, that var isnt used anywhere anyway
<FromGitter> <Blacksmoke16> only for preflight*
<FromGitter> <dyakubovich> Yes, thank you @Blacksmoke16 , problem was in method list by default
<FromGitter> <Blacksmoke16> oh it was failing the OPTIONS request?
<FromGitter> <dyakubovich> I added `GET` to the methods `methods = %w(GET POST PUT PATCH DELETE)` and `plug Amber::Pipe::CORS.new(origins: origins, headers: headers, methods: methods, credentials: true)` . So now it works
<FromGitter> <Blacksmoke16> but it was making an `OPTIONS` request?
<FromGitter> <dyakubovich> Yes
<FromGitter> <Blacksmoke16> i so that would make sense, `credentials` option is prob setting a cookie header which isnt a "safe" header so it triggers a preflight
alexherbo2 has quit [Ping timeout: 246 seconds]
alexherbo2_ has quit [Ping timeout: 260 seconds]
alexherbo2 has joined #amber
alexherbo2_ has joined #amber
alexherbo2_ has quit [Ping timeout: 256 seconds]
alexherbo2 has quit [Ping timeout: 264 seconds]
alexherbo2 has joined #amber
alexherbo2_ has joined #amber
<FromGitter> <samholst> @drujensen https://github.com/amberframework/amber/issues/1224, issue created :)
alexherbo2_ has quit [Ping timeout: 260 seconds]
alexherbo2 has quit [Ping timeout: 246 seconds]
<FromGitter> <drujensen> Thank you.
alexherbo2 has joined #amber
alexherbo2_ has joined #amber