refactor(headers): use String in Access-Control-Allow-Origin header

Access-Control-Allow-Origin origins are URLs but they do not need to
be valid, they should just be compared as strings. So to support
invalid URLs hyper should use a string instead.

closes #526

BREAKING CHANGE: Access-Control-Allow-Origin does no longer use Url
This commit is contained in:
Pyfisch
2015-07-04 17:20:41 +02:00
parent 990819a6d6
commit ed458628e5
2 changed files with 19 additions and 13 deletions

View File

@@ -3,6 +3,7 @@ use std::error::Error as StdError;
use std::fmt;
use std::io::Error as IoError;
use std::str::Utf8Error;
use std::string::FromUtf8Error;
use httparse;
use url;
@@ -127,6 +128,12 @@ impl From<Utf8Error> for Error {
}
}
impl From<FromUtf8Error> for Error {
fn from(err: FromUtf8Error) -> Error {
Utf8(err.utf8_error())
}
}
impl From<httparse::Error> for Error {
fn from(err: httparse::Error) -> Error {
match err {