We might want to switch to res.getHeader('Content-Disposition').
Can you also cache the result in a variable to avoid calculating it again?