backport FeedableBodyGenerator from master