5 Matching Annotations
- Jul 2023
-
-
```js exports.handler = async (event) => { if (event.headers != undefined) { const headers = toLowerCaseProperties(event.headers);
if (headers['sec-websocket-protocol'] != undefined) { const subprotocolHeader = headers['sec-websocket-protocol']; const subprotocols = subprotocolHeader.split(','); if (subprotocols.indexOf('myprotocol') >= 0) { const response = { statusCode: 200, headers: { "Sec-WebSocket-Protocol" : "myprotocol" } }; return response; } } } const response = { statusCode: 400 }; return response;
};function toLowerCaseProperties(obj) { var wrapper = {}; for (var key in obj) { wrapper[key.toLowerCase()] = obj[key]; } return wrapper; } ```
-
- Apr 2023
-
developer.mozilla.org developer.mozilla.org
-
developer.mozilla.org developer.mozilla.org
Tags
- http:header=sec-websocket-accept
- cito:cites=urn:ietf:rfc:7540
- cito:cites=urn:ietf:rfc:6455
- http:header=upgrade:websocket
- http:header=sec-websocket-key
- websocket
- http:header=sec-websocket-version
- http
- cito:cites=urn:ietf:rfc:7230
- http:header=connection:upgrade
- http:header=sec-websocket-protocol
- http:header=sec-websocket-extensions
Annotators
URL
-
- Jan 2023
-
www.bortzmeyer.org www.bortzmeyer.org
Tags
Annotators
URL
-
-
datatracker.ietf.org datatracker.ietf.orgrfc64551