Skip to content

Commit

Permalink
dont send directories
Browse files Browse the repository at this point in the history
  • Loading branch information
wagyourtail committed Jun 15, 2024
1 parent bbe33df commit d0d3aa5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion site/src/main/kotlin/xyz/wagyourtail/jvmdg/site/Main.kt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import javax.xml.transform.TransformerFactory
import javax.xml.transform.dom.DOMSource
import javax.xml.transform.stream.StreamResult
import kotlin.io.path.inputStream
import kotlin.io.path.isRegularFile
import kotlin.io.path.outputStream
import kotlin.time.Duration.Companion.days

Expand Down Expand Up @@ -211,7 +212,7 @@ fun main() {
it.inputStream().use { it.copyTo(path.outputStream()) }
}
}
if (content != null) {
if (content != null && content.isRegularFile()) {
call.respondOutputStream {
content.inputStream().use { it.copyTo(this) }
headers {
Expand Down

0 comments on commit d0d3aa5

Please sign in to comment.