Giter Club home page Giter Club logo

Comments (3)

filmaj avatar filmaj commented on July 17, 2024

Here's what the shape of a request object from the latest version of sandbox looks like:

{ method: 'get',
  httpMethod: 'get',
  path: '/',
  headers:
   { host: 'localhost:3333',
     connection: 'keep-alive',
     'upgrade-insecure-requests': '1',
     'user-agent':
      'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.36',
     accept:
      'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3',
     'accept-encoding': 'gzip, deflate, br',
     'accept-language': 'en-US,en;q=0.9,es-MX;q=0.8,es;q=0.7,pl-PL;q=0.6,pl;q=0.5',
     Cookie:
      'io=NwtYYc7ewLEqLp8iAAAC; AMCVS_707535C75AF1E1630A495E73%40AdobeOrg=1; AMCV_707535C75AF1E1630A495E73%40AdobeOrg=-330454231%7CMCIDTS%7C17962%7CMCMID%7C62533939180920330170689695036116870502%7CMCAAMLH-1552496273%7C9%7CMCAAMB-1552496273%7CRKhpRz8krg2tLO6pguXWp5olkAcUniQYPHaMWWgdJ3xzPWQmdj0y%7CMCOPTOUT-1551898673s%7CNONE%7CMCAID%7C2E172D528507D072-600001100001C2E5%7CvVersion%7C3.1.2; s_cc=true; s_dmdbase=1; AMCVS_9E1005A551ED61CA0A490D45%40AdobeOrg=1; AMCV_9E1005A551ED61CA0A490D45%40AdobeOrg=-1303530583%7CMCMID%7C62275305610138225320663840406792841947%7CMCAAMLH-1560882905%7C7%7CMCAAMB-1560882905%7CRKhpRz8krg2tLO6pguXWp5olkAcUniQYPHaMWWgdJ3xzPWQmdj0y%7CMCOPTOUT-1560285305s%7CNONE%7CvVersion%7C3.3.0%7CMCAID%7C2E0567BD85032066-4000119E0000544F%7CMCCIDH%7C64000490; s_nr=1560278350045-Repeat; adcloud={%22_les_v%22:%22y%2Clocalhost%2C1560280150%22}; s_ppv=[%22localhost/%22%2C26%2C0%2C669%2C1440%2C669%2C1440%2C900%2C2%2C%22P%22]; null; _idx=eyJhbGciOiJkaXIiLCJlbmMiOiJBMTI4R0NNIn0.._j8FIlciOSqJ-pt2.Ka1kZN0z_Tb6DA30XXS_joMtJkJlpo9_eZPTymp1Jjq0fMh6guufkZZtdCAUDn0s5zTGrQ.TVacZNNQ12OcoidySuJHTA' },
  query: {},
  queryStringParameters: {},
  body: {},
  params: {} }

Based on this, I would suggest we change the middleware implementation to look for the property httpMethod to differentiate between requests and responses, as httpMethod is present on both sandbox and lambda request objects.

from functions.

filmaj avatar filmaj commented on July 17, 2024

Quick gut check here: the keys of the request object that are consistent in both sandbox and lambda environments are:

[ 'path',
  'httpMethod',
  'headers',
  'queryStringParameters',
  'body' ]

from functions.

brianleroux avatar brianleroux commented on July 17, 2024

Yes and we need to add some to align w https://arc.begin.com/primitives/http

from functions.

Related Issues (20)

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.