Describe the bug
When running the search webapp container only on the SSL port and passing the appropriate SENZING_WEB_SERVER_URL env var with a https protocol the container healtcheck script throws an error.
Reason for error
there is no detection of protocol from SENZING_WEB_SERVER_URL or the SENZING_WEB_SERVER_PROTOCOL variable. http is always used.
Solution
Add a switch or if/else statement to do a https.get instead of a http.get when appropriate.
The following code blocks need to be modified to resolve in this scenario:
Expected behavior
healthcheck responds without error.
Error Stack
TypeError [ERR_INVALID_PROTOCOL]: Protocol "https:" not supported. Expected "http:"
at new NodeError (node:internal/errors:387:5)
at new ClientRequest (node:_http_client:186:11)
at request (node:http:97:10)
at Object.get (node:http:108:15)
at HealthCheckerUtility.checkIfWebServerAlive (/app/run/health/index.js:35:24)
at listOnTimeout (node:internal/timers:559:17)
at processTimers (node:internal/timers:502:7) {
code: 'ERR_INVALID_PROTOCOL'
Describe the bug When running the search webapp container only on the SSL port and passing the appropriate
SENZING_WEB_SERVER_URL
env var with a https protocol the container healtcheck script throws an error.Reason for error there is no detection of protocol from
SENZING_WEB_SERVER_URL
or theSENZING_WEB_SERVER_PROTOCOL
variable. http is always used.Solution Add a switch or if/else statement to do a
https.get
instead of ahttp.get
when appropriate. The following code blocks need to be modified to resolve in this scenario:Expected behavior healthcheck responds without error.
Error Stack