Jens Suhr
12/14/2022, 10:49 AMHostRouteSelector::evaluate function uses context.call.request.origin.serverPort to determine if a request matches the port routing filter. I’m not sure why it doesn’t call localPort instead, as that’s (as far as I understand) the port where the request is actually received.
We use a ktor application with CIO in k8s behind mapped ports and an ingress, so the port in the Host headers is something completely different from what we specify in our routing. Before 2.2, it worked - probably by accident - because CIO used the local information first.
Is there a way to make this work with 2.2? Doesn’t seem like an unusual use case, but I’m probably missing something simple here.Aleksei Tirman [JB]
12/14/2022, 11:00 AMHostRouteSelector where call.request.origin.localPort will be checked.Jens Suhr
12/14/2022, 11:29 AMAleksei Tirman [JB]
12/14/2022, 11:54 AMserverPort property, as you said, which refers to the port from the Host header if it’s present.Jens Suhr
12/14/2022, 12:09 PMJens Suhr
12/14/2022, 12:25 PMport(xxx) {} filter is the port that the connector is bound to, which is the localPort.
Then again, I might be missing something obvious here and just doing it wrong 😅Jens Suhr
12/14/2022, 3:43 PMlocalPort filter that does exactly what I’m looking for