Your function, not your html, would need that header. The custom headers functionality WILL NOT apply to functions; only what your function returns can add headers there.
Seems like you’ve removed that function in the meantime - did you abandon or did you end up implementing differently?