Add forward headers

This commit is contained in:
Alexander Nozik 2022-09-03 14:11:36 +03:00
parent 9e87eddcb6
commit 6d3d0420dd
No known key found for this signature in database
GPG Key ID: F7FCF2DD25C71357
3 changed files with 5 additions and 1 deletions

View File

@ -29,6 +29,7 @@ dependencies {
implementation("io.ktor:ktor-server-netty:$ktorVersion")
implementation("io.ktor:ktor-server-http-redirect:$ktorVersion")
implementation("io.ktor:ktor-server-forwarded-header:$ktorVersion")
implementation("ch.qos.logback:logback-classic:1.2.11")
testImplementation("io.ktor:ktor-server-tests:$ktorVersion")

View File

@ -1,6 +1,8 @@
package ru.mipt.spc
import io.ktor.server.application.Application
import io.ktor.server.application.install
import io.ktor.server.plugins.forwardedheaders.ForwardedHeaders
import space.kscience.snark.SnarkEnvironment
import space.kscience.snark.ktor.extractResources
import space.kscience.snark.ktor.prepareSnarkDataCacheDirectory
@ -11,6 +13,7 @@ import kotlin.io.path.div
@Suppress("unused")
fun Application.spcModule() {
// install(HttpsRedirect)
install(ForwardedHeaders)
val dataPath = Path.of("data")

View File

@ -125,7 +125,7 @@ context(WebPage) internal fun FlowContent.spcFooter() {
// }
li {
a(classes = "icon brands alt fa-github") {
href = "https://github.com/mipt-npm"
href = "https://github.com/SciProgCentre"
span("label") { +"""GitHub""" }
}
}