Skip to content

Commit

Permalink
Cherry pick PR #3943: Disable CORS preflight request upon command lin…
Browse files Browse the repository at this point in the history
…e flag (#3946)

Refer to the original PR: youtube/cobalt#3943

b/27175039

Co-authored-by: johnx <[email protected]>
  • Loading branch information
cobalt-github-releaser-bot and johnxwork committed Aug 9, 2024
1 parent c079cd6 commit 46f89c9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cobalt/loader/cors_preflight.cc
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,9 @@ bool CORSPreflight::IsPreflightNeeded() {
if (force_preflight_) {
return true;
}
if (cors_policy_ == network::kCORSOptional) {
return false;
}
// Preflight is not needed if the request method is CORS-safelisted request
// method and all headers are CORS-safelisted request-header.
std::vector<std::string> unsafe_headers;
Expand Down

0 comments on commit 46f89c9

Please sign in to comment.