Added code to check for 'X-Forwarded-Proto' HTTP Header and generate links with https OR http accordingly