File tree Expand file tree Collapse file tree 1 file changed +2
-13
lines changed
apollo-execution-ktor/src/commonMain/kotlin/com/apollographql/execution/ktor Expand file tree Collapse file tree 1 file changed +2
-13
lines changed Original file line number Diff line number Diff line change @@ -137,23 +137,12 @@ fun Application.apolloSubscriptionModule(
137137
138138fun Application.apolloSandboxModule (
139139 title : String = "API sandbox",
140- graphqlPath : String = "/graphql",
141140 sandboxPath : String = "/",
141+ endpoint : (RoutingCall ) -> String = { it.url { path("/graphql") } },
142142) {
143143 routing {
144144 get(sandboxPath) {
145- val initialEndpoint = call.url {
146- /* *
147- * Trying to guess if the client connected through HTTPS
148- */
149- val proto = call.request.header(" x-forwarded-proto" )
150- when (proto) {
151- " http" -> protocol = URLProtocol .HTTP
152- " https" -> protocol = URLProtocol .HTTPS
153- }
154- path(graphqlPath)
155- }
156- call.respondText(sandboxHtml(title, initialEndpoint), ContentType .parse(" text/html" ))
145+ call.respondText(sandboxHtml(title, endpoint(call)), ContentType .parse(" text/html" ))
157146 }
158147 }
159148}
You can’t perform that action at this time.
0 commit comments