Fix #14503: Cast to string before setting XHR header