Skip to content

Commit 096fa2f

Browse files
committed
Merge branch 'release/1.10.4'
2 parents 2f438f4 + 0f6ac2d commit 096fa2f

6 files changed

+20
-20
lines changed

.circleci/config.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ version: 2
33
references:
44
container_config: &container_config
55
docker:
6-
- image: circleci/node:12
6+
- image: cimg/node:22.1.0
77
poke_npmrc: &poke_npmrc
88
run: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
99

package-lock.json

+5-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "serverless-api-gateway-caching",
3-
"version": "1.10.3",
3+
"version": "1.10.4",
44
"description": "A plugin for the serverless framework which helps with configuring caching for API Gateway endpoints.",
55
"main": "src/apiGatewayCachingPlugin.js",
66
"scripts": {

src/cacheKeyParameters.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const applyCacheKeyParameterSettings = (settings, serverless) => {
2828
for (let cacheKeyParameter of endpointSettings.cacheKeyParameters) {
2929
if (!cacheKeyParameter.mappedFrom) {
3030
let existingValue = method.Properties.RequestParameters[`method.${cacheKeyParameter.name}`];
31-
method.Properties.RequestParameters[`method.${cacheKeyParameter.name}`] = (existingValue == null || existingValue == undefined) ? true : existingValue;
31+
method.Properties.RequestParameters[`method.${cacheKeyParameter.name}`] = (existingValue == null || existingValue == undefined) ? false : existingValue;
3232

3333
// without this check, endpoints 500 when using cache key parameters like "Authorization" or headers with the same characters in different casing (e.g. "origin" and "Origin")
3434
if (method.Properties.Integration.Type !== 'AWS_PROXY') {
@@ -43,7 +43,7 @@ const applyCacheKeyParameterSettings = (settings, serverless) => {
4343
cacheKeyParameter.mappedFrom.includes('method.request.header') ||
4444
cacheKeyParameter.mappedFrom.includes('method.request.path')
4545
) {
46-
method.Properties.RequestParameters[cacheKeyParameter.mappedFrom] = (existingValue == null || existingValue == undefined) ? true : existingValue;
46+
method.Properties.RequestParameters[cacheKeyParameter.mappedFrom] = (existingValue == null || existingValue == undefined) ? false : existingValue;
4747
}
4848

4949
// in v1.8.0 "lambda" integration check was removed because setting cache key parameters seemed to work for both AWS_PROXY and AWS (lambda) integration

test/configuring-cache-key-parameters-for-additional-endpoints.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ describe('Configuring path parameters for additional endpoints defined as CloudF
5454
for (let parameter of cacheKeyParameters) {
5555
expect(apiGatewayMethod.Properties.RequestParameters)
5656
.to.deep.include({
57-
[`method.${parameter.name}`]: true
57+
[`method.${parameter.name}`]: false
5858
});
5959
}
6060
});

test/configuring-cache-key-parameters.js

+10-10
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ describe('Configuring cache key parameters', () => {
6565
for (let parameter of cacheKeyParameters) {
6666
expect(method.Properties.RequestParameters)
6767
.to.deep.include({
68-
[`method.${parameter.name}`]: true
68+
[`method.${parameter.name}`]: false
6969
});
7070
}
7171
});
@@ -123,7 +123,7 @@ describe('Configuring cache key parameters', () => {
123123
for (let parameter of cacheKeyParameters) {
124124
expect(method.Properties.RequestParameters)
125125
.to.deep.include({
126-
[`method.${parameter.name}`]: true
126+
[`method.${parameter.name}`]: false
127127
});
128128
}
129129
});
@@ -203,7 +203,7 @@ describe('Configuring cache key parameters', () => {
203203
for (let parameter of cacheKeyParameters) {
204204
expect(method.Properties.RequestParameters)
205205
.to.deep.include({
206-
[`method.${parameter.name}`]: true
206+
[`method.${parameter.name}`]: false
207207
});
208208
}
209209
});
@@ -308,7 +308,7 @@ describe('Configuring cache key parameters', () => {
308308
for (let parameter of firstEndpointCacheKeyParameters) {
309309
expect(method.Properties.RequestParameters)
310310
.to.deep.include({
311-
[`method.${parameter.name}`]: true
311+
[`method.${parameter.name}`]: false
312312
});
313313
}
314314
});
@@ -343,7 +343,7 @@ describe('Configuring cache key parameters', () => {
343343
for (let parameter of secondEndpointCacheKeyParameters) {
344344
expect(method.Properties.RequestParameters)
345345
.to.deep.include({
346-
[`method.${parameter.name}`]: true
346+
[`method.${parameter.name}`]: false
347347
});
348348
}
349349
});
@@ -399,7 +399,7 @@ describe('Configuring cache key parameters', () => {
399399
for (let parameter of firstEndpointCacheKeyParameters) {
400400
expect(method.Properties.RequestParameters)
401401
.to.deep.include({
402-
[`method.${parameter.name}`]: true
402+
[`method.${parameter.name}`]: false
403403
});
404404
}
405405
});
@@ -434,7 +434,7 @@ describe('Configuring cache key parameters', () => {
434434
for (let parameter of secondEndpointCacheKeyParameters) {
435435
expect(method.Properties.RequestParameters)
436436
.to.deep.include({
437-
[`method.${parameter.name}`]: true
437+
[`method.${parameter.name}`]: false
438438
});
439439
}
440440
});
@@ -506,7 +506,7 @@ describe('Configuring cache key parameters', () => {
506506
for (let parameter of cacheKeyParameters) {
507507
expect(method.Properties.RequestParameters)
508508
.to.deep.include({
509-
[`method.${parameter.name}`]: true
509+
[`method.${parameter.name}`]: false
510510
});
511511
}
512512
});
@@ -568,7 +568,7 @@ describe('Configuring cache key parameters', () => {
568568
) {
569569
expect(method.Properties.RequestParameters)
570570
.to.deep.include({
571-
[parameter.mappedFrom]: true
571+
[parameter.mappedFrom]: false
572572
});
573573
}
574574
}
@@ -609,7 +609,7 @@ describe('Configuring cache key parameters', () => {
609609
) {
610610
expect(method.Properties.RequestParameters)
611611
.to.deep.include({
612-
[parameter.mappedFrom]: true
612+
[parameter.mappedFrom]: false
613613
});
614614
}
615615
}

0 commit comments

Comments
 (0)