aeruhxi
03/20/2018, 5:40 AMErick House
03/20/2018, 6:26 PMauthentication {
// challenge (pre configured auth) all sub routes and by challenging it somehow gets redirected to the login page
// I don't have access to the application call in the auth pipeline to redirect
route("account"){
}
route("admin"){
}
}
Erick House
03/21/2018, 1:38 AMTristan Caron
03/21/2018, 3:34 PMgyl
03/23/2018, 9:47 AMNail Gilaziev
03/25/2018, 9:35 AMjeremy
03/28/2018, 11:03 PMneworldlt
03/29/2018, 6:36 AMjeremy
03/29/2018, 6:37 PMNail Gilaziev
03/31/2018, 5:20 AMnoncom
04/01/2018, 11:58 AMmodule
as a function reference (not as a labmda), as instructed, and set the watchPaths
to my projects directory. When I launch the server, it shows a bunch of ... DEBUG ktor.application - Watching ...
messages with all the paths that are in the specified directory. So I suspect, it initializes ok. However, when I change anything in any of these files, there's no reaction from Ktor, no reloading, and not even an error or debug message.qweryt
04/03/2018, 4:20 PMfun main(args: Array<String>) {
val server = embeddedServer(Netty, 9995) {
install(DefaultHeaders)
install(Compression)
install(CallLogging)
routing {
route("test") {
param("error") {
handle {
call.respondText { "error" }
}
}
get {
call.respondText { "test" }
}
}
}
}
server.start()
}
If I understand correctly, then when I'm going to http://localhost:9995/test?error=123 I should get "error", but I'm getting "test".alex
04/05/2018, 11:01 PMfrellan
04/06/2018, 8:05 PMNail Gilaziev
04/07/2018, 4:35 PMPere Casafont
04/09/2018, 7:29 AMRobert Menke
04/10/2018, 2:46 AMpackage app
import freemarker.cache.ClassTemplateLoader
import io.ktor.application.*
import io.ktor.features.CallLogging
import io.ktor.features.DefaultHeaders
import io.ktor.freemarker.FreeMarker
import io.ktor.freemarker.FreeMarkerContent
import io.ktor.http.*
import io.ktor.response.*
import io.ktor.routing.*
import io.ktor.sessions.Sessions
import io.ktor.sessions.cookie
import io.ktor.websocket.WebSockets
import session.AuthenticatedSession
import sockets.SecureSocketServer
import java.time.Duration
fun Application.main() {
install(DefaultHeaders)
install(CallLogging)
//<https://ktor.io/features/sessions.html#install-basic>
install(Sessions) {
cookie<AuthenticatedSession>(AuthenticatedSession.NAME)
}
//<https://ktor.io/features/freemarker.html>
install(FreeMarker) {
templateLoader = ClassTemplateLoader(Application::class.java.classLoader, "templates")
}
//<https://ktor.io/features/routing.html>
routing()
}
fun Application.routing() {
install(Routing) {
get("/") {
call.respond(FreeMarkerContent("index.ftl", mapOf("test_name" to "World")))
}
}
}
leonhardt
04/10/2018, 3:27 AMmp
04/11/2018, 3:38 PMPipelineInterceptor
?) handle processing for a given path.jk2018
04/11/2018, 7:20 PMFelix
04/12/2018, 10:47 PMAharon
04/13/2018, 8:56 AMAharon
04/13/2018, 9:29 AMotakusenpai
04/13/2018, 12:51 PMaeruhxi
04/16/2018, 11:30 AMdanielm
04/16/2018, 12:35 PMuli
04/16/2018, 7:22 PMIncomingContent
can produce a ByteChannel
, but not not an asynchronousByteChannel
aeruhxi
04/17/2018, 10:44 AM0.9.1
. Same erroruli
04/18/2018, 7:49 AMBasicAuth
as client feature.
I do:
val apacheEnbgineFactory = Apache.config {
followRedirects = true
}
val ktorClient = HttpClient(apacheEnbgineFactory) {
install(BasicAuth) {
username = "test"
password = "test"
}
}
Trying to break inside the block passed to intercept
inside BasicAuth does never breakuli
04/18/2018, 7:53 AMio.ktor:ktor-client-features:0.9.1
seems to be empty