diff options
author | Quentin <quentin@deuxfleurs.fr> | 2020-11-20 21:23:32 +0100 |
---|---|---|
committer | Quentin <quentin@deuxfleurs.fr> | 2020-11-20 21:23:32 +0100 |
commit | 5b363626f4803b3e43cdb450fd6ee04ac9429c4d (patch) | |
tree | 7912c1d50f62c46e33fe89bb54d4e0d55821d249 /src/web/web_server.rs | |
parent | 2e94275e68b82f5e685ba7d2e8fcf0a31daf3b6c (diff) | |
download | garage-5b363626f4803b3e43cdb450fd6ee04ac9429c4d.tar.gz garage-5b363626f4803b3e43cdb450fd6ee04ac9429c4d.zip |
Support punnycode
Diffstat (limited to 'src/web/web_server.rs')
-rw-r--r-- | src/web/web_server.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/web/web_server.rs b/src/web/web_server.rs index 4771d209..1c5619fa 100644 --- a/src/web/web_server.rs +++ b/src/web/web_server.rs @@ -10,6 +10,8 @@ use hyper::server::conn::AddrStream; use hyper::service::{make_service_fn, service_fn}; use hyper::{Body, Request, Response, Server}; +use idna::domain_to_unicode; + use garage_model::garage::Garage; use garage_util::error::Error as GarageError; use crate::error::*; @@ -70,7 +72,7 @@ async fn serve_file(garage: Arc<Garage>, req: Request<Body>) -> Result<Response< .to_str()?; // Get bucket - let host = authority_to_host(authority)?; + let (host, _) = domain_to_unicode(authority_to_host(authority)?); let root = &garage.config.s3_web.root_domain; let bucket = host_to_bucket(&host, root); |