Skip to content

Commit 0a463d1

Browse files
Karol MaciaszekKent C. Dodds
Karol Maciaszek
authored and
Kent C. Dodds
committed
fix(devServer.cert): accepting proper types in cert,key and ca fields
1 parent c9eea8d commit 0a463d1

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

src/properties/devServer/index.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,12 @@ export default Joi.object({
1010
info: Joi.boolean(),
1111
quiet: Joi.boolean(),
1212
https: Joi.boolean(),
13-
key: Joi.string(),
14-
cert: Joi.string(),
15-
cacert: Joi.string(),
13+
key: Joi.binary(),
14+
cert: Joi.binary(),
15+
ca: [
16+
Joi.binary(),
17+
Joi.array().items(Joi.binary()),
18+
],
1619
contentBase: [
1720
Joi.object(),
1821
Joi.array(),

src/properties/devServer/index.test.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,12 @@ const validModuleConfigs = [
1010
{ input: { info: true } },
1111
{ input: { quiet: true } },
1212
{ input: { https: true } },
13-
{ input: { key: '/path/to/key' } },
14-
{ input: { cert: 'path/to/cert' } },
15-
{ input: { cacert: 'path/to/cacert' } },
13+
{ input: { key: 'key contents' } },
14+
{ input: { key: new Buffer('key contents') } },
15+
{ input: { cert: 'cert contents' } },
16+
{ input: { cert: new Buffer('cert contents') } },
17+
{ input: { ca: 'ca contents' } },
18+
{ input: { ca: ['ca contents 1', new Buffer('ca contents 2')] } },
1619
{ input: { contentBase: '/content/base' } },
1720
{ input: { contentBase: { target: '/content/base/' } } },
1821
{ input: { contentBase: ['/content/base/'] } },

0 commit comments

Comments
 (0)