core: fix return value of protocol redirect.
(cherry picked from commit 98be036e6ca0428aacb47ce560a04b038e495117)