Skip to content

Commit bd59b8c

Browse files
authored
Merge pull request #4119 from mbaklor/v3-alpha
[V3] add ".html" to assetFileServer requests with no extension
2 parents c8e3ba2 + abd27b2 commit bd59b8c

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

docs/src/content/docs/changelog.mdx

+1
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
107107
-  Ensure menu updates occur on the main thread by [@leaanthony](https://github.com/leaanthony)
108108
- The dragging and resizing mechanism is now more robust and matches expected platform behaviour more closely by [@fbbdev](https://github.com/fbbdev) in [#4100](https://github.com/wailsapp/wails/pull/4100)
109109
- Fixed [#4097](https://github.com/wailsapp/wails/issues/4097) Webpack/angular discards runtime init code by [@fbbdev](https://github.com/fbbdev) in [#4100](https://github.com/wailsapp/wails/pull/4100)
110+
- Fixed assetFileServer not serving `.html` files when non-extension request when `[request]` doesn't exist but `[request].html` does
110111

111112
### Changed
112113

v3/internal/assetserver/asset_fileserver.go

+9-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,15 @@ func (d *assetFileServer) serveFSFile(rw http.ResponseWriter, req *http.Request,
7171

7272
file, err := d.fs.Open(filename)
7373
if err != nil {
74-
return err
74+
if s := path.Ext(filename); s == "" {
75+
filename = filename + ".html"
76+
file, err = d.fs.Open(filename)
77+
if err != nil {
78+
return err
79+
}
80+
} else {
81+
return err
82+
}
7583
}
7684
defer file.Close()
7785

0 commit comments

Comments
 (0)