Fix issue with content-disposition existing with no filename when downloading

Another attempt at fixing #1269 

/cc @taavo