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 (#3961)

Refer to the original PR: #3943

b/27175039

Co-authored-by: johnx <[email protected]>
  • Loading branch information
cobalt-github-releaser-bot and johnxwork authored Aug 9, 2024
1 parent f445564 commit d3f7c42
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 d3f7c42

Please sign in to comment.