Skip to content

Commit

Permalink
Merge pull request ceph#12381 from ly798/fix-rgw-crush-due-to-bad-cors
Browse files Browse the repository at this point in the history
rgw: do not abort when accept a CORS request with short origin
  • Loading branch information
mattbenjamin authored Dec 8, 2016
2 parents fe814e7 + 67d4d9e commit e410733
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/rgw/rgw_cors.cc
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ static bool is_string_in_set(set<string>& s, string h) {
string sl = ssplit.front();
dout(10) << "Finding " << sl << ", in " << h
<< ", at offset not less than " << flen << dendl;
if (h.compare((h.size() - sl.size()), sl.size(), sl) != 0)
if (h.size() < sl.size() ||
h.compare((h.size() - sl.size()), sl.size(), sl) != 0)
continue;
ssplit.pop_front();
}
Expand Down

0 comments on commit e410733

Please sign in to comment.