jembi / openhim-core-js

The Open Health Information Mediator core component. OpenHIM Support: Post your query on OpenHIE Discourse using the #openhim tag https://discourse.ohie.org/
http://openhim.org
Mozilla Public License 2.0
69 stars 69 forks source link

fix: trust proxy ssl to forward session cookie #1193

Closed marrouchi closed 1 year ago

marrouchi commented 1 year ago

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 : https://github.com/koajs/koa/issues/974

NOTE : This should be tested in platform.

codecov[bot] commented 1 year ago

Codecov Report

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

:exclamation: 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%) :arrow_down:

... and 2 files with indirect coverage changes