Releases: mjpclab/go-http-file-server
Version 1.15.7
Minor improvements and fixes.
次要改进和修复。
Version 1.15.6
Minor improvements and fixes.
次要改进和修复。
Version 1.15.5
Minor improvements and fixes.
次要改进和修复。
Version 1.15.4
Main changes
output gzip compressed content if possible
fix issue cannot get file content under subdir alias in WSL1 compat mode
主要变更
如果可能,输出gzip压缩的文件内容
修复WSL1兼容模式下子目录别名下的文件内容无法获取的问题
Version 1.15.3
Minor improvements and fixes.
This project is now turned into Go module, which meas it is possible to be used by another Go module. See example for starting a file server by invoking ghfs as a library. Note ghfs does not follow semantic versioning strictly.
次要改进和修复。
此项目已转化为Go模块,即它可以被另一个Go模块所使用。查看示例,它把ghfs作为库调用启动一个文件服务器。注意ghfs不严格遵守语义化版本。
Version 1.15.2
Minor improvements and fixes.
This project is now turned into Go module, which meas it is possible to be used by another Go module. See example for starting a file server by invoking ghfs as a library. Note ghfs does not follow semantic versioning strictly.
次要改进和修复。
此项目已转化为Go模块,即它可以被另一个Go模块所使用。查看示例,它把ghfs作为库调用启动一个文件服务器。注意ghfs不严格遵守语义化版本。
Version 1.15.1
Minor improvements and fixes.
次要改进和修复。
Version 1.15.0
Breaking changes
Remove --bind
option
The purpose of providing --bind
is to provide a possibility to align the behavior with Windows that path is case-insensitive.
Use --alias
instead. It is now path-case-insensitive on Windows platform, while still case sensitive on unix like platform. Now it is impossible to use case-insensitive path alias on unix like platform.
Remove --base
option
Use --prefix
instead, it uses case-insensitive match on Windows platform.
Before:
- Use
--prefix
for case-sensitive prefix for all platforms. - Use
--base
for case-insensitive prefix for all platforms.
After:
- On Windows platform,
--prefix
matching is case-insensitive. - On non-Windows platform,
--prefix
matching is case-sensitive.
Rename --header
option to --global-header
--header
in previous version is renamed to --global-header
.
Now --header
is used to customize response header for specified URL paths.(See "New features" section).
New features
Several path related options are now case insensitive for matching path on Windows
On windows platform, it is possible to access a file system path without case matched. Thus, following path options are now using case-insensitive match on Windows platform:
--upload
--upload-dir
--mkdir
--mkdir-dir
--delete
--delete-dir
--archive
--archive-dir
--cors
--cors-dir
--auth
--auth-dir
Add --header
and --header-dir
to customize response header for specified paths
--header <separator><url-path><separator><name><separator><value> ...
Add custom HTTP response header for a specific URL path(and sub path).
--header-dir <separator><fs-path><separator><name><separator><value> ...
Similar to --header
, but use file system path instead of URL path.
Restrict access from third party host
Restrict access from third party host by detecting request header Referer
or Origin
.
Add --global-restrict-access [allow-host, ...]
to restrict access for all url paths.
Add --restrict-access <sep><url-path>[<sep><allow-host>...]
to restrict access for specific url paths.
Add --restrict-access-dir <sep><fs-path>[<sep><allow-host>...]
to restrict access for specific file system paths.
If the request header is empty, directory list page is still allowed to access.
If allowed host is not specified, file content can only be accessed from current host. Note this will not help to restrict access from other one who point a domain to your host and could be matched to current virtual host, unless specifying the allowed host explicitly.
The "host" could be a hostname which means using a default port, or the form of "host:port".
Add --force-dir-slash
option
Use this option to force redirect directory list page without "/" suffix in the URL to the URL with the suffix.
破坏性变更
移除--bind
选项
提供--bind
选项的目的是提供一种可能性,使路径匹配的行为与Windows系统保持一致,即不区分大小写。
请改用--alias
。它现在在Windows平台上不区分大小写,而在类unix 的平台上仍然区分大小写。现在无法在类unix平台上使用不区分大小写的别名。
移除--base
选项
请改用--prefix
,它在Windows平台上使用不区分大小写的匹配。
之前:
- 使用
--prefix
指定所有平台的区分大小写的服务前缀 - 使用
--base
指定所有平台的不区分大小写的服务前缀
之后:
- 在Widnows平台上,
--prefix
的匹配是不区分大小写的 - 在非Widnows平台上,
--prefix
的匹配是区分大小写的
--header
选项改名为--global-header
之前版本中的--header
已重命名为--global-header
。
现在--header
用于自定义指定URL路径的响应头(参见“新特性”部分)。
新特性
数个与路径有关的选项在Windows上匹配时不再区分大小写
在Windows平台上,可以访问大小写不匹配的文件系统路径。 因此,在Windows平台上,以下路径选项现在使用不区分大小写的匹配:
--upload
--upload-dir
--mkdir
--mkdir-dir
--delete
--delete-dir
--archive
--archive-dir
--cors
--cors-dir
--auth
--auth-dir
添加--header
和--header-dir
来为指定的路径自定义响应头
--header <separator><url-path><separator><name><separator><value> ...
为指定的URL路径(及子路径)添加自定义HTTP响应头。
--header-dir <separator><fs-path><separator><name><separator><value> ...
与--header类似 ,但使用文件系统路径而不是URL路径。
限制来自第三方主机的访问
限制来自第三方主机用户的访问,它是通过检测请求头中的Referer
或Origin
实现的。
添加--global-restrict-access [allow-host, ...]
对所有URL施加访问限制。
添加--restrict-access <sep><url-path>[<sep><allow-host>...]
对指定的URL路径施加访问限制。
添加--restrict-access-dir <sep><fs-path>[<sep><allow-host>...]
对指定的文件系统路径施加访问限制。
如果请求头为空,仍然允许访问目录列表页。
如果未指定允许的第三方主机,文件内容仅可被当前主机访问。注意这样无法限制把域名指向你的主机且能匹配当前虚拟主机的人,除非明确指定允许的主机。
“主机”可以是主机名,即使用默认端口,也可以是“主机:端口”的形式。
添加--force-dir-slash
选项
使用此选项强制将URL中不带“/”后缀的目录列表页重定向到带后缀的URL。
Version 1.14.0
Main changes
Add --prefix
and --base
to serve files under a specific sub url path.
Could be useful if server is behind a reverse proxy and received the request without proxying path stripped.
Symbol links are now dereferenced to actual file or directory they point to.
Fix issue that cannot upload over 100 files within single directory at one time. #21
Other fixes and improvements.
主要变更
添加--prefix
和--base
指定在URL子路径下提供服务。
如果服务器在反向代理之后,且收到的请求并未去除代理路径前缀,可能较有用。
符号链接现在被解引用到它实际指向的文件或目录。
修复上传文件到单个目录下,一次不能超过100个的问题。 #21
其他修复和改进。
Version 1.13.7
Main Changes
- can specify PID file by environment variable
GHFS_PID_FILE
- if requested URL is escaped, display the original URL in the log, and filter special characters
- fixed the issue that the file item was still removed after file deletion failed
- fixed the issue that some ancient browsers still delete file after selecting cancel in the delete confirmation dialog
主要变更
- 可使用环境变量
GHFS_PID_FILE
指定PID文件 - 如请求的URL被转义,在日志中同时显示转义前的原始URL,并过滤特殊字符
- 修复删除文件失败后仍然移除文件项的问题
- 修复部分老旧浏览器在“确认删除”对话框中选择取消,依旧删除文件的问题