(metadata)
| 4530 | return referrerOrigin; |
| 4531 | } |
| 4532 | case "strict-origin": |
| 4533 | case "no-referrer-when-downgrade": |
| 4534 | default: |
| 4535 | return isNonPotentiallyTrustWorthy ? "no-referrer" : referrerOrigin; |
| 4536 | } |
| 4537 | } |
| 4538 | function stripURLForReferrer(url, originOnly) { |
| 4539 | assert(url instanceof URL); |
| 4540 | url = new URL(url); |
| 4541 | if (url.protocol === "file:" || url.protocol === "about:" || url.protocol === "blank:") { |
| 4542 | return "no-referrer"; |
| 4543 | } |
| 4544 | url.username = ""; |
| 4545 | url.password = ""; |
| 4546 | url.hash = ""; |
| 4547 | if (originOnly) { |
| 4548 | url.pathname = ""; |
| 4549 | url.search = ""; |
| 4550 | } |
| 4551 | return url; |
| 4552 | } |
| 4553 | function isURLPotentiallyTrustworthy(url) { |
no test coverage detected