=rem #3555: Wrong and superfluous match in EndpointWriter (backport)

(cherry picked from commit 89a3454)