Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: trust proxy ssl to forward session cookie #1193

Merged
merged 6 commits into from
May 30, 2023
Merged

Conversation

marrouchi
Copy link
Contributor

@marrouchi marrouchi commented May 18, 2023

Motivation

I was deploying OpenHIM for Indonesia on Google Cloud Run. OpenHIM is served behing a proxy that issues the SSL.
It was impossible to connect through OpenHIM console. When checking the logs I found the following error : "Error: Cannot send secure cookie over unencrypted connection"
Basically, you cannot set "secure=true" for the cookie and then serve it in HTTP. For that we needed that option to trust that the proxy.

Check : koajs/koa#974

NOTE : This should be tested in platform.

@codecov
Copy link

codecov bot commented May 18, 2023

Codecov Report

Merging #1193 (186cec0) into master (ee71267) will decrease coverage by 0.04%.
The diff coverage is 50.00%.

❗ Current head 186cec0 differs from pull request most recent head 6cad525. Consider uploading reports for the commit 6cad525 to get more accurate results

@@            Coverage Diff             @@
##           master    #1193      +/-   ##
==========================================
- Coverage   86.67%   86.64%   -0.04%     
==========================================
  Files          87       87              
  Lines        5876     5877       +1     
==========================================
- Hits         5093     5092       -1     
- Misses        783      785       +2     
Impacted Files Coverage Δ
src/koaApi.js 99.28% <50.00%> (-0.72%) ⬇️

... and 2 files with indirect coverage changes

rcrichton
rcrichton previously approved these changes May 18, 2023
Copy link
Member

@rcrichton rcrichton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Collaborator

@arran-standish arran-standish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just 2 small changes

marrouchi and others added 2 commits May 19, 2023 10:33
Co-authored-by: arran-standish <[email protected]>
Co-authored-by: arran-standish <[email protected]>
arran-standish
arran-standish previously approved these changes May 19, 2023
@michaelloosen michaelloosen merged commit b73bc64 into master May 30, 2023
@michaelloosen michaelloosen deleted the fix/cookie-proxy branch May 30, 2023 09:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants