From 5b363626f4803b3e43cdb450fd6ee04ac9429c4d Mon Sep 17 00:00:00 2001 From: Quentin Date: Fri, 20 Nov 2020 21:23:32 +0100 Subject: [PATCH] Support punnycode --- Cargo.lock | 1 + src/web/Cargo.toml | 2 +- src/web/web_server.rs | 4 +++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4e1ad32f..9e0a1bb0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -661,6 +661,7 @@ dependencies = [ "hex", "http", "hyper", + "idna", "log", "percent-encoding", "rand", diff --git a/src/web/Cargo.toml b/src/web/Cargo.toml index 8eddf047..252ee58d 100644 --- a/src/web/Cargo.toml +++ b/src/web/Cargo.toml @@ -41,4 +41,4 @@ rustls = "0.17" webpki = "0.21" roxmltree = "0.11" - +idna = "0.2" 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, req: Request) -> Result