Proposed patch for #2589 to guard against content spoofing.

http://trac.buildbot.net/ticket/2589
Ditto