Ensures that DTDs do not cause resources to be downloaded

(Backport of #1622/dc94b94 from master)