MCPcopy Index your code
hub / github.com/nodejs/node / initOriginSet

Function initOriginSet

lib/internal/http2/core.js:695–717  ·  view source on GitHub ↗
(session)

Source from the content-addressed store, hash-verified

693}
694
695function initOriginSet(session) {
696 let originSet = session[kState].originSet;
697 if (originSet === undefined) {
698 const socket = session[kSocket];
699 session[kState].originSet = originSet = new SafeSet();
700 let hostName = socket.servername;
701 if (hostName === null || hostName === false) {
702 if (socket.remoteFamily === 'IPv6') {
703 hostName = `[${socket.remoteAddress}]`;
704 } else {
705 hostName = socket.remoteAddress;
706 }
707 }
708 let originString = `https://${hostName}`;
709 if (socket.remotePort != null)
710 originString += `:${socket.remotePort}`;
711 // We have to ensure that it is a properly serialized
712 // ASCII origin string. The socket.servername might not
713 // be properly ASCII encoded.
714 originSet.add(getURLOrigin(originString));
715 }
716 return originSet;
717}
718
719function onOrigin(origins) {
720 const session = this[kOwner];

Callers 3

onSessionHeadersFunction · 0.85
onOriginFunction · 0.85
originSetMethod · 0.85

Calls 2

getURLOriginFunction · 0.85
addMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…