Determine HTTP version of incoming request in springboot webflux
Asked Answered
B

1

6

I’m looking for a way to find the HTTP version of incoming request in spring webflux netty server

I cannot find any method in ServerWebExchange to get this information.

Spring servlet has some implementation to get it as given in springboot servlet.

Is it any possibility to get it in webflux implementation?

Bibby answered 11/3, 2021 at 4:11 Comment(0)
E
0

It's really awful, but this works:

final var protocol = ((ReactorServerHttpRequest) exchange.getRequest()).request.protocol();

ReactorServerHttpRequest will not be on your classpath by default, tho. It's provided at runtime by Netty. I agree this is a hole in the WebFlux spec.

Entebbe answered 4/10 at 18:45 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.