Skip to content
This repository has been archived by the owner on May 16, 2023. It is now read-only.

apigw::ApiGatewayWebsocketProxyRequestContext.http_method should be optional #38

Closed
jquesada2016 opened this issue Aug 11, 2021 · 2 comments

Comments

@jquesada2016
Copy link

Problem

I am unable to use the ApiGatewayWebsocketProxyRequest, and therefore, ApiGatewayWebsocketProxyRequestContext, to serialize WebSocket events from API Gateway because the field http_method does not exist on the emitted event.

Actual Received Event

{
    "headers": {
        "Accept-Encoding": "gzip, deflate, br",
        "Accept-Language": "en-US,en;q=0.9",
        "Cache-Control": "no-cache",
        "Host": "/* host */",
        "Origin": "http://localhost:3000",
        "Pragma": "no-cache",
        "Sec-WebSocket-Extensions": "permessage-deflate; client_max_window_bits",
        "Sec-WebSocket-Key": "/* key */",
        "Sec-WebSocket-Version": "13",
        "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 Safari/537.36 Edg/92.0.902.67",
        "X-Amzn-Trace-Id": "/* id */",
        "X-Forwarded-For": "/* ip */",
        "X-Forwarded-Port": "443",
        "X-Forwarded-Proto": "https"
    },
    "isBase64Encoded": false,
    "multiValueHeaders": {
        "Accept-Encoding": [
            "gzip, deflate, br"
        ],
        "Accept-Language": [
            "en-US,en;q=0.9"
        ],
        "Cache-Control": [
            "no-cache"
        ],
        "Host": [
            "/* host */"
        ],
        "Origin": [
            "http://localhost:3000"
        ],
        "Pragma": [
            "no-cache"
        ],
        "Sec-WebSocket-Extensions": [
            "permessage-deflate; client_max_window_bits"
        ],
        "Sec-WebSocket-Key": [
            "/* key */"
        ],
        "Sec-WebSocket-Version": [
            "13"
        ],
        "User-Agent": [
            "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 Safari/537.36 Edg/92.0.902.67"
        ],
        "X-Amzn-Trace-Id": [
            "/* id */"
        ],
        "X-Forwarded-For": [
            "/* ip */"
        ],
        "X-Forwarded-Port": [
            "443"
        ],
        "X-Forwarded-Proto": [
            "https"
        ]
    },
    "requestContext": {
        "apiId": "/* appId */",
        "connectedAt": 1628718944028,
        "connectionId": "/* connectionId */",
        "domainName": "/* domain */",
        "eventType": "CONNECT",
        "extendedRequestId": "/* id */",
        "identity": {
            "sourceIp": "/* ip */",
            "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 Safari/537.36 Edg/92.0.902.67"
        },
        "messageDirection": "IN",
        "requestId": "/* id */",
        "requestTime": "11/Aug/2021:21:55:44 +0000",
        "requestTimeEpoch": 1628718944030,
        "routeKey": "$connect",
        "stage": "dev"
    }
}
@LegNeato
Copy link
Contributor

I believe this was fixed by #34

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants