Avoid an unnecessary string allocation in allow_cross_origin_request.

This commit is contained in:
Ms2ger 2014-09-23 21:33:38 +02:00
parent 4546d5d23c
commit 1ffb683145

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