mirror of
https://github.com/fafhrd91/actix-web
synced 2025-06-25 22:49:21 +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:
@ -1,5 +1,9 @@
|
||||
# Changes
|
||||
|
||||
## [0.2.1] - 2019-12-22
|
||||
|
||||
* Use the same format for file URLs regardless of platforms
|
||||
|
||||
## [0.2.0] - 2019-12-20
|
||||
|
||||
* Fix BodyEncoding trait import #1220
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "actix-files"
|
||||
version = "0.2.0"
|
||||
version = "0.2.1"
|
||||
authors = ["Nikolay Kim <fafhrd91@gmail.com>"]
|
||||
description = "Static files support for actix web."
|
||||
readme = "README.md"
|
||||
|
@ -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,
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user