fixes #10032 upstream: https://github.com/jvinet/knock/issues/54 (cherry picked from commit 93c6e37c)