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(
137
137
138
138
fun Application.apolloSandboxModule (
139
139
title : String = "API sandbox",
140
- graphqlPath : String = "/graphql",
141
140
sandboxPath : String = "/",
141
+ endpoint : (RoutingCall ) -> String = { it.url { path("/graphql") } },
142
142
) {
143
143
routing {
144
144
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" ))
157
146
}
158
147
}
159
148
}
You can’t perform that action at this time.
0 commit comments