Giter Site home page Giter Site logo

aws-lambda-rie-gateway's People

Contributors

bassrock avatar eagletmt avatar maks3w avatar shotarotsuji avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

aws-lambda-rie-gateway's Issues

Error: RIE Gateway expects a `cookies` fields in the responses

Hello!

I have a lambda that is served using RIE, which was set up using the following docker-compose.yaml:

version: '2.4'

services:
  # https://github.com/eagletmt/aws-lambda-rie-gateway
  apigw:
    image: public.ecr.aws/eagletmt/aws-lambda-rie-gateway
    environment:
      TARGET_URL: http://app:8080
    ports:
      - 8080:8080

  app:
    image: drift_checker
    build: drift_checker
    working_dir: /usr/src
    mem_limit: 128m
    cpus: 0.2

And with the following code:

def handler(event, context):
    return {
        "statusCode": 200,
        "headers": {
            "Content-Type": "application/json"
        },
        "body": {}
    }

The following error is returned:

src-apigw-1  | 2022-11-11T22:39:57.504677Z  INFO aws_lambda_rie_gateway: Send upstream request: {"version":"2.0","routeKey":null,"rawPath":"/","rawQueryString":null,"cookies":null,"headers":{"host":"docker:8080","user-agent":"curl/7.82.0","accept":"*/*","content-length":"197","content-type":"application/x-www-form-urlencoded"},"queryStringParameters":{},"pathParameters":{},"requestContext":{"routeKey":"$default","accountId":"","stage":"$default","requestId":"","authorizer":null,"apiId":"","domainName":"","domainPrefix":"","time":"11/Nov/2022:22:39:57 +0000","timeEpoch":1668206397504,"http":{"method":"POST","path":"/","protocol":"HTTP/1.1","sourceIp":null,"userAgent":null},"authentication":null},"stageVariables":{},"body":"[REDACTED]","isBase64Encoded":true}
src-apigw-1  | 2022-11-11T22:40:03.685465Z ERROR aws_lambda_rie_gateway: error decoding response body: missing field `cookies` at line 1 column 3369

Of course, if I change the implementation to include a cookies field in the response, it works flawlessly =D

Now, I don´t know if there is documentation describing how each response interface should be treated, but I would like to suggest making cookies an optional attribute.

What do you think?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.