aws-serverless-express-edge
aws-serverless-express-edge copied to clipboard
hostHeader.startsWith is not a function
I get this error. I cannot access the _http_agent.js I don't have that file. Is there a way to solve this?
hostHeader.startsWith is not a function
at calculateServerName (_http_agent.js:240:20)
at Agent.addRequest (_http_agent.js:155:26)
at new ClientRequest (_http_client.js:258:16)
at Object.request (http.js:42:10)
at forwardRequestToNodeServer (/var/task/node_modules/aws-serverless-express-edge/index.js:129:26)
at Object.proxy (/var/task/node_modules/aws-serverless-express-edge/index.js:188:9)
@dfloresgonz The cause of the problem is that the request header is an object. As I fixed this problem, please see below. https://github.com/Karibash/aws-serverless-express-edge/commit/d4a80f14b39e33d8822f44d8267629818ae2030c
were you able to get it working? I
wrote my own module that does what this package does, but I keep getting a timeout when it does http.request(options, ...)
I had to modify the library:
in the function mapEdgeEventToHttpRequest I added:
headers.host = headers.host[0].value;
@dfloresgonz did you get it actually working though? I'm getting socket hangup (ECONNRESET on "http.request()"), just curious if it's indeed possible to run express on lambda@edge!
@burritoland well I'm not sure yet I don't get the error anymore but my page is blank but no error in the browser console.