CodeGenieApp / CodeGenieApp/serverless-express

Support for Cloudfront as event source

Offen
#583 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
JavaScript
Sterne
5.3k
Forks
676
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

I've got requests passing through a Cloudfront distribution directly to a lambda, no cache, passing all request headers with it. I'm using this approach because API Gateway and ALB are both overkill for my use-case, simply need a public endpoint with custom domain compatibility, hence Cloudfront.

Issue is that this library produces a `Unable to determine event source based on event` error in this setup. Having a look at the code it seems [here](https://github.com/vendia/serverless-express/blob/75cfbffeb3fd030695b9587a75300c7b8012ac6a/src/event-sources/utils.js#L70) that there is no conditional to detect this circumstance.

Since I'm passing all headers directly through Cloudfront, I assume that the event in this case looks a lot like it came directly from the client, rather than something triggered through another cloud service. This seems to me perhaps as a valid default case to design for in this library, in the absence of any other forwarders?

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.