Explorar o código

fix(examples): properly load request path in streaming example

Lucas Nogueira %!s(int64=3) %!d(string=hai) anos
pai
achega
5666c0bce8
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  1. 3 0
      examples/streaming/main.rs

+ 3 - 0
examples/streaming/main.rs

@@ -47,6 +47,9 @@ fn main() {
       let path = request.uri().replace("stream://localhost/", "");
       #[cfg(not(target_os = "windows"))]
       let path = request.uri().replace("stream://", "");
+      let path = percent_encoding::percent_decode(path.as_bytes())
+        .decode_utf8_lossy()
+        .to_string();
 
       if path != "example/test_video.mp4" {
         // return error 404 if it's not out video