refactor: rename --cors to --enable-cors (#57)

BREAKING CHANGE: `--cors` rename to `--enable-cors`
This commit is contained in:
sigoden
2022-06-19 17:27:09 +08:00
committed by GitHub
parent 051ff8da2d
commit e66951fd11
4 changed files with 16 additions and 17 deletions

View File

@@ -59,7 +59,7 @@ impl Server {
) -> Result<Response, hyper::Error> {
let method = req.method().clone();
let uri = req.uri().clone();
let cors = self.args.cors;
let enable_cors = self.args.enable_cors;
let mut res = match self.handle(req).await {
Ok(res) => {
@@ -77,7 +77,7 @@ impl Server {
}
};
if cors {
if enable_cors {
add_cors(&mut res);
}
Ok(res)