diff options
Diffstat (limited to 'src/bun.js/bindings/URLDecomposition.cpp')
-rw-r--r-- | src/bun.js/bindings/URLDecomposition.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/bun.js/bindings/URLDecomposition.cpp b/src/bun.js/bindings/URLDecomposition.cpp index d3f11b27f..21168f70f 100644 --- a/src/bun.js/bindings/URLDecomposition.cpp +++ b/src/bun.js/bindings/URLDecomposition.cpp @@ -35,7 +35,14 @@ String URLDecomposition::origin() const if (fullURL.protocolIsInHTTPFamily() or fullURL.protocolIsInFTPFamily() or fullURL.protocolIs("ws"_s) or fullURL.protocolIs("wss"_s)) return fullURL.protocolHostAndPort(); - + if (fullURL.protocolIsBlob()) { + const String& path = fullURL.path().toString(); + const URL subUrl { URL {}, path }; + if (subUrl.isValid()) { + if (subUrl.protocolIsInHTTPFamily() or subUrl.protocolIsInFTPFamily() or subUrl.protocolIs("ws"_s) or subUrl.protocolIs("wss"_s) or subUrl.protocolIsFile()) + return subUrl.protocolHostAndPort(); + } + } return "null"_s; } |