Skip to content

Commit 75eb3f5

Browse files
committed
feat: remove WSL1 compat mode
1 parent 05c0f92 commit 75eb3f5

File tree

4 files changed

+1
-68
lines changed

4 files changed

+1
-68
lines changed

src/app/main.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import (
1010
"mjpclab.dev/ghfs/src/setting"
1111
"mjpclab.dev/ghfs/src/tpl/defaultTheme"
1212
"mjpclab.dev/ghfs/src/tpl/theme"
13-
"mjpclab.dev/ghfs/src/util"
1413
"os"
1514
"path/filepath"
1615
"strconv"
@@ -49,12 +48,6 @@ func NewApp(params param.Params, setting *setting.Setting) (*App, []error) {
4948
}
5049
}
5150

52-
if serverHandler.TryEnableWSL1Fix() && !setting.Quiet {
53-
ttyFile, teardownTtyFile := util.GetTTYFile()
54-
ttyFile.WriteString("WSL 1 compatible mode enabled\n")
55-
teardownTtyFile()
56-
}
57-
5851
vhSvc := goVirtualHost.NewService()
5952
logFileMan := serverLog.NewFileMan()
6053
themes := make(map[string]theme.Theme)

src/serverHandler/aliasHandler.go

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ import (
1414

1515
var defaultHandler = http.NotFoundHandler()
1616

17-
var createFileServer func(aliasUrl, aliasFs string) http.Handler
18-
1917
type pathStrings struct {
2018
path string
2119
strings []string
@@ -104,8 +102,6 @@ type aliasHandler struct {
104102
vary string
105103

106104
postMiddlewares []middleware.Middleware
107-
108-
fileServer http.Handler
109105
}
110106

111107
func (h *aliasHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
@@ -213,11 +209,6 @@ func newAliasHandler(
213209
}
214210
}
215211

216-
var fileServer http.Handler
217-
if !emptyRoot && createFileServer != nil { // for WSL 1 fix
218-
fileServer = createFileServer(currentAlias.url, currentAlias.fs)
219-
}
220-
221212
h := &aliasHandler{
222213
root: currentAlias.fs,
223214
emptyRoot: emptyRoot,
@@ -276,8 +267,6 @@ func newAliasHandler(
276267
hideDirs: ap.hideDirs,
277268
hideFiles: ap.hideFiles,
278269

279-
fileServer: fileServer,
280-
281270
vary: ap.vary,
282271

283272
postMiddlewares: p.PostMiddlewares,

src/serverHandler/content.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,10 @@ import (
44
"mjpclab.dev/ghfs/src/util"
55
"net/http"
66
"net/url"
7-
"os"
87
"strconv"
98
"time"
109
)
1110

12-
var serveContent = func(h *aliasHandler, w http.ResponseWriter, r *http.Request, info os.FileInfo, file *os.File) {
13-
http.ServeContent(w, r, info.Name(), info.ModTime(), file)
14-
}
15-
1611
func (h *aliasHandler) content(w http.ResponseWriter, r *http.Request, data *responseData) {
1712
header := w.Header()
1813
header.Set("Vary", h.vary)
@@ -25,7 +20,7 @@ func (h *aliasHandler) content(w http.ResponseWriter, r *http.Request, data *res
2520
file := data.File
2621

2722
if NeedResponseBody(r.Method) {
28-
serveContent(h, w, r, item, file)
23+
http.ServeContent(w, r, item.Name(), item.ModTime(), file)
2924
return
3025
}
3126

src/serverHandler/wsl1.go

Lines changed: 0 additions & 44 deletions
This file was deleted.

0 commit comments

Comments
 (0)