Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

changed --insecure-proxy to --secure-proxy in ember serve command #6166

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/commands/serve.js
Expand Up @@ -22,7 +22,7 @@ module.exports = Command.extend({
{ name: 'port', type: Number, default: defaultPort, aliases: ['p'] },
{ name: 'host', type: String, aliases: ['H'], description: 'Listens on all interfaces by default' },
{ name: 'proxy', type: String, aliases: ['pr', 'pxy'] },
{ name: 'insecure-proxy', type: Boolean, default: false, aliases: ['inspr'], description: 'Set false to proxy self-signed SSL certificates' },
{ name: 'secure-proxy', type: Boolean, default: true, aliases: ['spr'], description: 'Set to false to proxy self-signed SSL certificates' },
{ name: 'transparent-proxy', type: Boolean, default: true, aliases: ['transp'], description: 'Set to false to omit x-forwarded-* headers when proxying' },
{ name: 'watcher', type: String, default: 'events', aliases: ['w'] },
{ name: 'live-reload', type: Boolean, default: true, aliases: ['lr'] },
Expand Down
2 changes: 1 addition & 1 deletion lib/tasks/server/middleware/proxy-server/index.js
Expand Up @@ -13,7 +13,7 @@ ProxyServerAddon.prototype.serverMiddleware = function(options) {
var proxy = require('http-proxy').createProxyServer({
target: options.proxy,
ws: true,
secure: !options.insecureProxy,
secure: options.secureProxy,
changeOrigin: true,
xfwd: options.transparentProxy
});
Expand Down
4 changes: 2 additions & 2 deletions tests/fixtures/help/help-with-addon.txt
Expand Up @@ -124,8 +124,8 @@ ember serve \u001b[36m<options...>\u001b[39m
\u001b[90maliases: -H <value>\u001b[39m
\u001b[36m--proxy\u001b[39m \u001b[36m(String)\u001b[39m
\u001b[90maliases: -pr <value>, -pxy <value>\u001b[39m
\u001b[36m--insecure-proxy\u001b[39m \u001b[36m(Boolean)\u001b[39m \u001b[36m(Default: false)\u001b[39m Set false to proxy self-signed SSL certificates
\u001b[90maliases: --inspr\u001b[39m
\u001b[36m--secure-proxy\u001b[39m \u001b[36m(Boolean)\u001b[39m \u001b[36m(Default: true)\u001b[39m Set to false to proxy self-signed SSL certificates
\u001b[90maliases: -spr\u001b[39m
\u001b[36m--transparent-proxy\u001b[39m \u001b[36m(Boolean)\u001b[39m \u001b[36m(Default: true)\u001b[39m Set to false to omit x-forwarded-* headers when proxying
\u001b[90maliases: --transp\u001b[39m
\u001b[36m--watcher\u001b[39m \u001b[36m(String)\u001b[39m \u001b[36m(Default: events)\u001b[39m
Expand Down
10 changes: 5 additions & 5 deletions tests/fixtures/help/help.js
Expand Up @@ -488,11 +488,11 @@ module.exports = {
required: false
},
{
name: 'insecure-proxy',
default: false,
description: 'Set false to proxy self-signed SSL certificates',
aliases: ['inspr'],
key: 'insecureProxy',
name: 'secure-proxy',
default: true,
description: 'Set to false to proxy self-signed SSL certificates',
aliases: ['spr'],
key: 'secureProxy',
required: false
},
{
Expand Down
4 changes: 2 additions & 2 deletions tests/fixtures/help/help.txt
Expand Up @@ -124,8 +124,8 @@ ember serve \u001b[36m<options...>\u001b[39m
\u001b[90maliases: -H <value>\u001b[39m
\u001b[36m--proxy\u001b[39m \u001b[36m(String)\u001b[39m
\u001b[90maliases: -pr <value>, -pxy <value>\u001b[39m
\u001b[36m--insecure-proxy\u001b[39m \u001b[36m(Boolean)\u001b[39m \u001b[36m(Default: false)\u001b[39m Set false to proxy self-signed SSL certificates
\u001b[90maliases: --inspr\u001b[39m
\u001b[36m--secure-proxy\u001b[39m \u001b[36m(Boolean)\u001b[39m \u001b[36m(Default: true)\u001b[39m Set to false to proxy self-signed SSL certificates
\u001b[90maliases: -spr\u001b[39m
\u001b[36m--transparent-proxy\u001b[39m \u001b[36m(Boolean)\u001b[39m \u001b[36m(Default: true)\u001b[39m Set to false to omit x-forwarded-* headers when proxying
\u001b[90maliases: --transp\u001b[39m
\u001b[36m--watcher\u001b[39m \u001b[36m(String)\u001b[39m \u001b[36m(Default: events)\u001b[39m
Expand Down
10 changes: 5 additions & 5 deletions tests/fixtures/help/with-addon-blueprints.js
Expand Up @@ -520,11 +520,11 @@ module.exports = {
required: false
},
{
name: 'insecure-proxy',
default: false,
description: 'Set false to proxy self-signed SSL certificates',
aliases: ['inspr'],
key: 'insecureProxy',
name: 'secure-proxy',
default: true,
description: 'Set to false to proxy self-signed SSL certificates',
aliases: ['spr'],
key: 'secureProxy',
required: false
},
{
Expand Down
10 changes: 5 additions & 5 deletions tests/fixtures/help/with-addon-commands.js
Expand Up @@ -488,11 +488,11 @@ module.exports = {
required: false
},
{
name: 'insecure-proxy',
default: false,
description: 'Set false to proxy self-signed SSL certificates',
aliases: ['inspr'],
key: 'insecureProxy',
name: 'secure-proxy',
default: true,
description: 'Set to false to proxy self-signed SSL certificates',
aliases: ['spr'],
key: 'secureProxy',
required: false
},
{
Expand Down
10 changes: 5 additions & 5 deletions tests/unit/commands/serve-test.js
Expand Up @@ -152,21 +152,21 @@ describe('serve command', function() {
});
});

it('has correct insecure proxy option', function() {
it('has correct secure proxy option', function() {
return command.validateAndRun([
'--insecure-proxy'
'--secure-proxy', 'false'
]).then(function() {
var captor = td.matchers.captor();
td.verify(tasks.Serve.prototype.run(captor.capture()), {times: 1});
expect(captor.value.insecureProxy).to.equal(true, 'has correct insecure proxy option');
expect(captor.value.secureProxy).to.equal(false, 'has correct insecure proxy option');
});
});

it('has correct default value for insecure proxy', function() {
it('has correct default value for secure proxy', function() {
return command.validateAndRun().then(function() {
var captor = td.matchers.captor();
td.verify(tasks.Serve.prototype.run(captor.capture()), {times: 1});
expect(captor.value.insecureProxy).to.equal(false, 'has correct insecure proxy option when not set');
expect(captor.value.secureProxy).to.equal(true, 'has correct secure proxy option when not set');
});
});

Expand Down