1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-07-01 00:44:26 +02:00

Enable GitHub Actions and fix file URL behavior (#1232)

* Use GitHub Actions

* Fix unused imports on Windows

* Fix test for Windows

* Stop to run CI for i686-pc-windows-msvc for now

* Use `/` instead of `\` on Windows

* Add entry to changelog

* Prepare actix-files release
This commit is contained in:
Yuki Okushi
2019-12-22 16:43:41 +09:00
committed by GitHub
parent 3751a4018e
commit f45db1f909
5 changed files with 84 additions and 6 deletions

View File

@ -155,7 +155,7 @@ impl Directory {
// show file url as relative to static path
macro_rules! encode_file_url {
($path:ident) => {
utf8_percent_encode(&$path.to_string_lossy(), CONTROLS)
utf8_percent_encode(&$path, CONTROLS)
};
}
@ -178,7 +178,8 @@ fn directory_listing(
if dir.is_visible(&entry) {
let entry = entry.unwrap();
let p = match entry.path().strip_prefix(&dir.path) {
Ok(p) => base.join(p),
Ok(p) if cfg!(windows) => base.join(p).to_string_lossy().replace("\\", "/"),
Ok(p) => base.join(p).to_string_lossy().into_owned(),
Err(_) => continue,
};