move type validation to getAllHeadersString