Skip to content

Commit 823291e

Browse files
Fabilinvsct-jburet
authored andcommitted
fixes #1895 web_connector: add X-Accel-Buffering header to SSE responses
1 parent 4652017 commit 823291e

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

shared/src/main/kotlin/vertx/VertXs.kt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ import io.vertx.core.VertxOptions.DEFAULT_WORKER_POOL_SIZE
3333
import io.vertx.core.http.HttpServerResponse
3434
import io.vertx.ext.web.Route
3535
import io.vertx.ext.web.RoutingContext
36+
import java.time.Duration
37+
import java.util.concurrent.Callable
38+
import java.util.concurrent.CompletableFuture
3639
import kotlinx.coroutines.slf4j.MDCContext
3740
import kotlinx.coroutines.slf4j.MDCContextMap
3841
import mu.KotlinLogging
3942
import mu.withLoggingContext
40-
import java.time.Duration
41-
import java.util.concurrent.Callable
42-
import java.util.concurrent.CompletableFuture
4343

4444
private val logger = KotlinLogging.logger {}
4545

@@ -225,6 +225,7 @@ fun HttpServerResponse.setupSSE(): CompositeFuture {
225225
add("Content-Type", "text/event-stream;charset=UTF-8")
226226
add("Connection", "keep-alive")
227227
add("Cache-Control", "no-cache")
228+
add("X-Accel-Buffering", "no")
228229
}
229230
return sendSsePing()
230231
}

0 commit comments

Comments
 (0)