Add two new $_SERVER variables: req.protocol and req.protocol+'://'+req.headers['host']

Can you add to the core the protocol used? Useful when building URLs.

For nodejs it would be HTTP_PROTOCOL: req.protocol

We can workaround it by using ternary on $_SERVER.HTTPS but seeing how it is actually built HTTPS: req.protocol == 'https'it seems kind of ironic :slight_smile:

Anyway I added it to my core files but it would be nice if they don’t get overwritten on next update :slight_smile:

Additionally this one would be nice too:

HTTP_BASE_URL: req.protocol+'://'+req.headers['host'],

Community Page
Last updated: