mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Add support and enable out-of-Blink CORS (fixes issue #2716)
It can still be disabled for a short time by passing `--disable-features=OutOfBlinkCors` on the command-line.
This commit is contained in:
@@ -244,12 +244,6 @@ bool AlloyMainDelegate::BasicStartupComplete(int* exit_code) {
|
||||
|
||||
std::vector<std::string> disable_features;
|
||||
|
||||
if (network::features::kOutOfBlinkCors.default_state ==
|
||||
base::FEATURE_ENABLED_BY_DEFAULT) {
|
||||
// TODO: Add support for out-of-Blink CORS (see issue #2716)
|
||||
disable_features.push_back(network::features::kOutOfBlinkCors.name);
|
||||
}
|
||||
|
||||
#if defined(OS_WIN)
|
||||
if (features::kCalculateNativeWinOcclusion.default_state ==
|
||||
base::FEATURE_ENABLED_BY_DEFAULT) {
|
||||
|
@@ -8,6 +8,7 @@
|
||||
#include "libcef/common/net/scheme_info.h"
|
||||
#include "libcef/features/runtime.h"
|
||||
|
||||
#include "base/stl_util.h"
|
||||
#include "content/public/common/url_constants.h"
|
||||
#include "extensions/common/constants.h"
|
||||
#include "net/net_buildflags.h"
|
||||
@@ -86,4 +87,10 @@ bool IsStandardScheme(const std::string& scheme) {
|
||||
return url::IsStandard(scheme.c_str(), scheme_comp);
|
||||
}
|
||||
|
||||
// Should return the same value as SecurityOrigin::isLocal and
|
||||
// SchemeRegistry::shouldTreatURLSchemeAsCorsEnabled.
|
||||
bool IsCorsEnabledScheme(const std::string& scheme) {
|
||||
return base::Contains(url::GetCorsEnabledSchemes(), scheme);
|
||||
}
|
||||
|
||||
} // namespace scheme
|
||||
|
@@ -22,6 +22,9 @@ bool IsInternalHandledScheme(const std::string& scheme);
|
||||
// Returns true if the specified |scheme| is a registered standard scheme.
|
||||
bool IsStandardScheme(const std::string& scheme);
|
||||
|
||||
// Returns true if the specified |scheme| is a registered CORS enabled scheme.
|
||||
bool IsCorsEnabledScheme(const std::string& scheme);
|
||||
|
||||
} // namespace scheme
|
||||
|
||||
#endif // CEF_LIBCEF_COMMON_NET_SCHEME_REGISTRATION_H_
|
||||
|
Reference in New Issue
Block a user