aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMs2ger <ms2ger@gmail.com>2014-09-23 21:33:38 +0200
committerMs2ger <ms2ger@gmail.com>2014-09-23 21:33:38 +0200
commit1ffb6831458d8fe6c70e9257736e6464fec9fcea (patch)
tree2d8d69131b10cfcbdd55dc3fb02ef047ac587a80
parent4546d5d23caa3f459b75e9a0bf9e91a3376dc197 (diff)
downloadservo-1ffb6831458d8fe6c70e9257736e6464fec9fcea.tar.gz
servo-1ffb6831458d8fe6c70e9257736e6464fec9fcea.zip
Avoid an unnecessary string allocation in allow_cross_origin_request.
-rw-r--r--components/script/cors.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/components/script/cors.rs b/components/script/cors.rs
index a4702eb21de..5bcb737a504 100644
--- a/components/script/cors.rs
+++ b/components/script/cors.rs
@@ -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()) {