How does Koa determine if cookies are going over a secure connection? #1826
Unanswered
christianjuth
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm deploying my Koa server to Fly.io. My domain is https, but I think whatever proxy Fly.io has set up is stripping away the encryption layer – I don't have much experience with proxies.
As far as I can tell, Fly.io is doing everything correctly.
I'm also setting
proxy.true
when creating my fly server.I have the following options when I set my cookie.
However, cookies package continues to reject the secure cookie saying
cannot send secure cookie over unencrypted connection
.But I found this workaround:
First, I'm wondering if there are any obvious security issues with this. Does
ctx.secure = true
imply that it's ok to send a secure cookie? Note, my fly config is set to force https, so I'm pretty sure my connections are secure, at least up to the proxy.Is there something obvious that I'm missing here? Looking at the Koa source code, I'm guessing
request.secure = false
but then why wouldctx.secure = true
?Beta Was this translation helpful? Give feedback.
All reactions