Skip to content

Commit

Permalink
Disable CORS preflight request upon command line flag (#3943)
Browse files Browse the repository at this point in the history
b/27175039

(cherry picked from commit d4ec2d6)
  • Loading branch information
johnxwork authored and anonymous1-me committed Aug 7, 2024
1 parent 11f2090 commit 340b238
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 340b238

Please sign in to comment.