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
  • Loading branch information
johnxwork authored Aug 7, 2024
1 parent 315901e commit d4ec2d6
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 d4ec2d6

Please sign in to comment.