(referer)
| 331 | |
| 332 | function extractNoteIdFromSocket (socket) { |
| 333 | function extractNoteIdFromReferer (referer) { |
| 334 | if (referer) { |
| 335 | const hostUrl = parseUrl(referer) |
| 336 | if (!hostUrl) { |
| 337 | return false |
| 338 | } |
| 339 | if (config.urlPath) { |
| 340 | return hostUrl.pathname.slice(config.urlPath.length + 1, hostUrl.pathname.length).split('/')[1] |
| 341 | } |
| 342 | return hostUrl.pathname.split('/')[1] |
| 343 | } |
| 344 | return false |
| 345 | } |
| 346 | |
| 347 | if (!socket || !socket.handshake) { |
| 348 | return false |
no test coverage detected