(url, originOnly)
| 4459 | } |
| 4460 | return referrerOrigin; |
| 4461 | } |
| 4462 | case "strict-origin": |
| 4463 | case "no-referrer-when-downgrade": |
| 4464 | default: |
| 4465 | return isNonPotentiallyTrustWorthy ? "no-referrer" : referrerOrigin; |
| 4466 | } |
| 4467 | } |
| 4468 | function stripURLForReferrer(url, originOnly) { |
| 4469 | assert(url instanceof URL); |
| 4470 | url = new URL(url); |
| 4471 | if (url.protocol === "file:" || url.protocol === "about:" || url.protocol === "blank:") { |
| 4472 | return "no-referrer"; |
| 4473 | } |
| 4474 | url.username = ""; |
| 4475 | url.password = ""; |
| 4476 | url.hash = ""; |
| 4477 | if (originOnly) { |
| 4478 | url.pathname = ""; |
no outgoing calls
no test coverage detected