Swift download: only call setHeader if defined