Merge pull request #3462 from Ms2ger/as-slice

Avoid an unnecessary string allocation in allow_cross_origin_request; r=jdm
This commit is contained in:
Ms2ger 2014-09-23 22:34:54 +02:00
commit 178843456f

View file

@ -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()) {