You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was trying out some socket connections that relied on https.request inside Nodebox when I first saw the following error:
Mixed Content: The page at 'https://nodebox-runtime.codesandbox.io/worker-360phrzywik3ot71qeou7g44viv8u49.js' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://my-url:27017/'. This request has been blocked; the content must be served over HTTPS
Bare in mind that all of this was previously tested in a "normal" node environment and worked without any issues. 👍
Problem
After debugging a little bit, it looks like the problem origins from nodebox abstraction of https.request not setting the protocol property value to https as the regular node one does.
If you take a look at both JSON chunks, you will notice that the nodebox version doesn't define the protocol property and it ends up doing a http request if one passes a relative URL without the protocol set.
REPRODUCIBLE SANDBOX
You will see the exact same error in this sandbox, and although this one has a "dummy" URL and credentials, the problem is still the exact same with authentic ones. 👇
Context
I was trying out some socket connections that relied on
https.request
inside Nodebox when I first saw the following error:Bare in mind that all of this was previously tested in a "normal"
node
environment and worked without any issues. 👍Problem
After debugging a little bit, it looks like the problem origins from
nodebox
abstraction ofhttps.request
not setting the protocol property value tohttps
as the regularnode
one does.node
stringified version ofhttps.request
: ✔️nodebox
stringified version ofhttps.request
: ❌If you take a look at both JSON chunks, you will notice that the
nodebox
version doesn't define theprotocol
property and it ends up doing ahttp
request if one passes a relative URL without the protocol set.REPRODUCIBLE SANDBOX
You will see the exact same error in this sandbox, and although this one has a "dummy" URL and credentials, the problem is still the exact same with authentic ones. 👇
https://codesandbox.io/p/sandbox/brave-swirles-4inf6s
The text was updated successfully, but these errors were encountered: