fix #66375 bad logic in sapi header callback routine