mirror of
https://github.com/servo/servo.git
synced 2025-07-24 15:50:21 +01:00
Avoid an unnecessary string allocation in allow_cross_origin_request.
This commit is contained in:
parent
4546d5d23c
commit
1ffb683145
1 changed files with 1 additions and 1 deletions
|
@ -404,7 +404,7 @@ pub fn allow_cross_origin_request(req: &CORSRequest, headers: &ResponseHeaderCol
|
|||
match allow_cross_origin_request {
|
||||
Some(h) => {
|
||||
let origin_str = h.header_value();
|
||||
if origin_str == "*".to_string() {
|
||||
if origin_str.as_slice() == "*" {
|
||||
return true; // Not always true, depends on credentials mode
|
||||
}
|
||||
match UrlParser::new().parse(origin_str.as_slice()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue