Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hostHeader.startsWith is not a function #3

Open
dfloresgonz opened this issue Mar 12, 2020 · 5 comments
Open

hostHeader.startsWith is not a function #3

dfloresgonz opened this issue Mar 12, 2020 · 5 comments

Comments

@dfloresgonz
Copy link

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)
@Karibash
Copy link

Karibash commented Mar 14, 2020

@dfloresgonz
The cause of the problem is that the request header is an object.
As I fixed this problem, please see below.
Karibash@d4a80f1

@hoIIer
Copy link

hoIIer commented Mar 21, 2020

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, ...)

@dfloresgonz
Copy link
Author

I had to modify the library:
in the function mapEdgeEventToHttpRequest I added:
headers.host = headers.host[0].value;

@hoIIer
Copy link

hoIIer commented Mar 22, 2020

@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!

@dfloresgonz
Copy link
Author

dfloresgonz commented Mar 22, 2020

@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.

@github-staff github-staff deleted a comment from maulanaayub May 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants
@hoIIer @dfloresgonz @Karibash and others