DianaIonita / serverless-api-gateway-caching

A plugin for the Serverless framework which helps with configuring caching for API Gateway endpoints.
ISC License
136 stars 35 forks source link

Internal Server Error when setting cache key parameter request.header.Authorization #110

Closed eggboy0 closed 2 years ago

eggboy0 commented 2 years ago

I have the following in serverless.yml:

GET method that uses Lambda Proxy Integration:

        caching:
            enabled: true
            cacheKeyParameters:
              - name: request.header.Authorization
GET /api-path
Headers:
  Authorization: Bearer <token>

However, this always yields no results due to Internal Server Error when there should be results. By removing the caching for the method, it works fine.

I am using a custom Token-based lambda authorizer. The token source is "Authorization". Not sure if that makes a difference?

Here's the error I see from X-Ray trace:

Error 403: Execution failed due to configuration error: The request signature we calculated does not match the signature you provided.

Any ideas?

DianaIonita commented 2 years ago

Hi @eggboy0,

Thanks for reporting the issue. Please use the previous version 1.7.5 for now while I work on a fix. I will let you know when sorted.

DianaIonita commented 2 years ago

Hi @eggboy0,

I just released v1.8.1 which should fix your problem. Please reopen the issue if that's not the case.