5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-07 21:10:26 +08:00

Merge pull request #4119 from mbaklor/v3-alpha

[V3] add ".html" to assetFileServer requests with no extension
This commit is contained in:
Lea Anthony 2025-03-08 12:02:54 +11:00 committed by GitHub
commit bd59b8c724
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 1 deletions

View File

@ -107,6 +107,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
-  Ensure menu updates occur on the main thread by [@leaanthony](https://github.com/leaanthony) -  Ensure menu updates occur on the main thread by [@leaanthony](https://github.com/leaanthony)
- 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) - 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)
- 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) - 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)
- Fixed assetFileServer not serving `.html` files when non-extension request when `[request]` doesn't exist but `[request].html` does
### Changed ### Changed

View File

@ -70,9 +70,17 @@ func (d *assetFileServer) serveFSFile(rw http.ResponseWriter, req *http.Request,
} }
file, err := d.fs.Open(filename) file, err := d.fs.Open(filename)
if err != nil {
if s := path.Ext(filename); s == "" {
filename = filename + ".html"
file, err = d.fs.Open(filename)
if err != nil { if err != nil {
return err return err
} }
} else {
return err
}
}
defer file.Close() defer file.Close()
statInfo, err := file.Stat() statInfo, err := file.Stat()