> What's the harm in suggesting a file name if the original name already ends with .pdf

Not sure how it will affect filenames with international characters. So I would like not to suggest anything if it's not required.

> download.aspx?path=foo.pdf would still print download.aspx.

yep, that's what I'm looking for, so it will fall back to your algorithm