"",
"groovy",
"html",
- "js.map",
+ "map",
"mtl",
"obj",
"old",
attributes.put(PageDoNotCacheAttributeKey, true)
val stat = FileStorage.instance.statFile(path) ?: return respond(HttpStatusCode.NotFound)
- val extension = path.elements.last().substringAfter('.', "")
+ val extension = path.elements.last().substringAfterLast('.', "")
val type = if (extension in textExtensions) ContentType.Text.Plain else ContentType.defaultForFileExtension(extension)
val result = FileStorage.instance.readFile(path) { producer ->
respondBytesWriter(contentType = type, contentLength = stat.size, producer = producer)
package info.mechyrdia.lore
+import info.mechyrdia.OwnerNationId
+import info.mechyrdia.data.currentNation
import info.mechyrdia.route.CsrfProtectedResourcePayload
import info.mechyrdia.route.Root
import info.mechyrdia.route.href
h1 { +title }
body()
}
- else if (request.uri.startsWith("/admin/vfs"))
+ else if (request.uri.startsWith("/admin/vfs") && currentNation()?.id == OwnerNationId)
adminPage(title) {
div(classes = "message") {
h1 { +title }