* Checks if the resolved URL has a disallowed protocol-relative path. * * @param resolved The resolved URL. * @param allowProtocolRelative Whether protocol-relative URLs are allowed. * @returns True if the URL has a disallowed protocol-relative path, false otherwise.
(resolved: URL, allowProtocolRelative: boolean)
| 133 | * @returns True if the URL has a disallowed protocol-relative path, false otherwise. |
| 134 | */ |
| 135 | function isDisallowedProtocolRelative(resolved: URL, allowProtocolRelative: boolean): boolean { |
| 136 | return !allowProtocolRelative && resolved.pathname.startsWith('//'); |
| 137 | } |
| 138 | |
| 139 | /** |
| 140 | * Throws a protocol-relative URL error indicating that protocol-relative URLs are not allowed. |