修复: 文件预览误报脏标记与编辑丢失等一批缺陷
- 脏标记行尾归一(含裸\r),CRLF 文件打开不再误报未保存 - 防抖回灌校验发起文件+flushEmit,杜绝串文件与丢尾 - F5/tab淘汰/读失败/草稿/重命名/保存刷新六处状态一致性修复 - GBK 文件按原编码回写(接口零改动),保存不再悄悄转 UTF-8 - .sh 系高亮根修(StreamLanguage 导入源错),面包屑长名截断 - CSV 大文件门豁免+表头贴顶;空标题滤除与 iframe 边距去除 - BGM 播放器增强收编(拖拽seek/音量/连播/快捷键/路径导航折叠) - 版本 0.5.3,CHANGELOG 同步
This commit is contained in:
1 parent
e5e8054916
commit
bce14a0480
26 files changed
+1010
-138
No files matched your search
@@ -277,7 +277,7 @@ func handleLocalFileRequest(w http.ResponseWriter, r *http.Request) {
|
||||
transformedContent := transformCssContent(string(content), basePath)
|
||||
|
||||
w.Header().Set("Content-Type", "text/css")
|
||||
w.Header().Set("Cache-Control", "public, max-age=3600")
|
||||
w.Header().Set("Cache-Control", "no-store")
|
||||
w.Write([]byte(transformedContent))
|
||||
log.Printf("[LocalFileHandler] CSS文件转换完成: %s (原始=%d, 转换后=%d)", filePath, len(content), len(transformedContent))
|
||||
return
|
||||
@@ -299,7 +299,7 @@ func handleLocalFileRequest(w http.ResponseWriter, r *http.Request) {
|
||||
transformedContent := transformJsDynamicImports(string(content), basePath)
|
||||
|
||||
w.Header().Set("Content-Type", "application/javascript")
|
||||
w.Header().Set("Cache-Control", "public, max-age=3600")
|
||||
w.Header().Set("Cache-Control", "no-store")
|
||||
w.Write([]byte(transformedContent))
|
||||
log.Printf("[LocalFileHandler] JS文件转换完成: %s (原始=%d, 转换后=%d)", filePath, len(content), len(transformedContent))
|
||||
return
|
||||
@@ -317,12 +317,9 @@ func handleLocalFileRequest(w http.ResponseWriter, r *http.Request) {
|
||||
// 设置响应头
|
||||
contentType := getContentType(ext)
|
||||
w.Header().Set("Content-Type", contentType)
|
||||
// 媒体文件禁用缓存(避免 Chromium ERR_CACHE_OPERATION_NOT_SUPPORTED)
|
||||
if isMediaExt(ext) {
|
||||
w.Header().Set("Cache-Control", "no-store")
|
||||
} else {
|
||||
w.Header().Set("Cache-Control", "public, max-age=3600")
|
||||
}
|
||||
// 预览文件一律禁用缓存:文件内容变化后同 URL 必须返回新内容,
|
||||
// 此前的 max-age=3600 会让本地/远程文件预览命中浏览器 1 小时缓存(陈旧内容,刷新也无效)
|
||||
w.Header().Set("Cache-Control", "no-store")
|
||||
// 支持 Range 请求
|
||||
w.Header().Set("Accept-Ranges", "bytes")
|
||||
|
||||
|
||||
Reference in new issue
Block a user