feat(adapter): add getConnInfo for AWS Lambda, Cloudflare Pages, and Netlify #4649
+410
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds
getConnInfo()support to three adapters that were previously missing this functionality:cf-connecting-ipheader (same as Workers)context.ip+ bonusgetGeo()helperChanges
AWS Lambda (
hono/aws-lambda)requestContext.identity.sourceIp(API Gateway v1)requestContext.http.sourceIp(API Gateway v2 / Function URLs)x-forwarded-forheader (ALB)Cloudflare Pages (
hono/cloudflare-pages)cf-connecting-ipheader (identical to Cloudflare Workers)Netlify (
hono/netlify)context.ipfor client IPgetGeo()helper for geolocation data (city, country, subdivision, timezone, postalCode, etc.)Usage Examples
References
Checklist