mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-08 19:04:45 +00:00
Bug 1619953 - P12 - Blob data is retrieved locally for non-http/https URLs r=baku
Differential Revision: https://phabricator.services.mozilla.com/D85868
This commit is contained in:
parent
a53a3bfb23
commit
49786eae4d
@ -363,7 +363,7 @@ void BlobURLInputStream::RetrieveBlobData(const MutexAutoLock& aProofOfLock) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (XRE_IsParentProcess()) {
|
||||
if (XRE_IsParentProcess() || !BlobURLSchemeIsHTTPOrHTTPS(mBlobURLSpec)) {
|
||||
nsIPrincipal* const dataEntryPrincipal =
|
||||
BlobURLProtocolHandler::GetDataEntryPrincipal(mBlobURLSpec,
|
||||
true /* AlsoIfRevoked */);
|
||||
|
@ -30,6 +30,7 @@
|
||||
#include "nsIPrincipal.h"
|
||||
#include "nsIUUIDGenerator.h"
|
||||
#include "nsNetUtil.h"
|
||||
#include "nsReadableUtils.h"
|
||||
|
||||
#define RELEASING_TIMER 5000
|
||||
|
||||
@ -898,6 +899,11 @@ bool IsType(nsIURI* aUri, DataInfo::ObjectType aType) {
|
||||
|
||||
bool IsBlobURI(nsIURI* aUri) { return IsType(aUri, DataInfo::eBlobImpl); }
|
||||
|
||||
bool BlobURLSchemeIsHTTPOrHTTPS(const nsACString& aUri) {
|
||||
return (StringBeginsWith(aUri, "blob:http://"_ns) ||
|
||||
StringBeginsWith(aUri, "blob:https://"_ns));
|
||||
}
|
||||
|
||||
bool IsMediaSourceURI(nsIURI* aUri) {
|
||||
return IsType(aUri, DataInfo::eMediaSource);
|
||||
}
|
||||
|
@ -99,6 +99,9 @@ class BlobURLProtocolHandler final : public nsIProtocolHandler,
|
||||
bool IsBlobURI(nsIURI* aUri);
|
||||
bool IsMediaSourceURI(nsIURI* aUri);
|
||||
|
||||
// Return true if inner scheme of blobURL is http or https, false otherwise.
|
||||
bool BlobURLSchemeIsHTTPOrHTTPS(const nsACString& aUri);
|
||||
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user