(session)
| 693 | } |
| 694 | |
| 695 | function 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 | |
| 719 | function onOrigin(origins) { |
| 720 | const session = this[kOwner]; |
no test coverage detected
searching dependent graphs…