Skip to content

Commit 25b4d5e

Browse files
committed
server: AssetsHandler will now allow serving of SPA index.html even if requested directory in assets exists
1 parent 466a6f0 commit 25b4d5e

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
* core: logger(name) is now accessible without a class instance context
33
* core: Any.logger() will now take the closest non-anonymous superclass
44
* server: errors.on<SomeException>(StatusCode) convenience reified function added
5+
* server: AssetsHandler will now allow serving of SPA index.html even if requested directory in assets exists
56
* jdbc: BaseCrudRepository.list() and by() now both have the suffix parameter
67
* jdbc: handle Postgres "cached plan must not change result type" exception by enabling autosave=conservative by default
78

server/src/klite/AssetsHandler.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ open class AssetsHandler(
3232
if (!file.startsWith(path)) throw ForbiddenException(exchange.path)
3333
if (file.isDirectory()) file /= indexFile
3434
if (!file.exists()) {
35-
if (useIndexForUnknownPaths && !file.name.contains(".")) file = path / indexFile
35+
if (useIndexForUnknownPaths && !exchange.path.contains(".")) file = path / indexFile
3636
else throw NotFoundException(exchange.path)
3737
}
3838
send(exchange, file)

0 commit comments

Comments
 (0)