Skip to content

Commit a6babaa

Browse files
committed
added: support for x-forwarded-protocol
1 parent 40496b7 commit a6babaa

3 files changed

Lines changed: 7 additions & 6 deletions

File tree

changes.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ Framework supports a backward compatibility.
3737
- added: framework.on('controller-render-meta', function(controller) {})
3838
- added: framework.on('init')
3939
- added: framework.merge('/merge.js', '/js/file1.js', '/js/file2.js')
40+
- added: framework supports X-Forwarded-Protocol header
4041

4142
- updated: (IMPORTANT) all models are loaded after is the framework loaded
4243
- updated: Utils.request(), timeout is possible to add as cookie, headers or encoding

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3801,7 +3801,7 @@ Framework.prototype._request = function(req, res) {
38013801
self.emit('request', req, res);
38023802

38033803
var headers = req.headers;
3804-
var protocol = req.connection.encrypted ? 'https' : 'http';
3804+
var protocol = req.connection.encrypted || headers['x-forwarded-protocol'] === 'https' ? 'https' : 'http';
38053805

38063806
if (self._request_check_redirect) {
38073807
var redirect = self.routes.redirects[protocol + '://' + req.host];

0 commit comments

Comments
 (0)